Merge Bob Fewell's 'mainwin2' into master.

This commit is contained in:
John Ralls 2022-12-30 13:43:00 -08:00
commit 5c17950a59
104 changed files with 10966 additions and 6085 deletions

View File

@ -39,6 +39,7 @@
#include "gnc-ui.h"
#include "gnc-window.h"
#include "dialog-utils.h"
#include "gnc-gtk-utils.h"
/** Names of signals generated by the embedded window. */
enum
@ -72,8 +73,12 @@ typedef struct GncEmbeddedWindowPrivate
* stored here when the UI manager provides them to the main
* window. */
GtkWidget *menu_dock;
/* The toolbar created by the UI manager. This pointer provides
* easy access for showing/hiding the toolbar. */
/** The menubar */
GtkWidget *menubar; //FIXMEb added
/** The menubar_model */
GMenuModel *menubar_model; //FIXMEb added
/** The toolbar. This pointer provides easy access for
* showing/hiding the toolbar. */
GtkWidget *toolbar;
/** A pointer to the status bar at the bottom edge of the window.
* This pointer provides easy access for updating/showing/hiding
@ -83,7 +88,7 @@ typedef struct GncEmbeddedWindowPrivate
/** The group of all actions provided by the main window itself.
* 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;
@ -123,8 +128,6 @@ 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);
LEAVE(" ");
}
@ -153,9 +156,6 @@ gnc_embedded_window_close_page (GncEmbeddedWindow *window,
priv->page = NULL;
gnc_plugin_page_removed (page);
gnc_plugin_page_unmerge_actions (page, window->ui_merge);
gtk_ui_manager_ensure_update (window->ui_merge);
gnc_plugin_page_destroy_widget (page);
g_object_unref(page);
LEAVE(" ");
@ -236,8 +236,8 @@ gnc_embedded_window_init (GncEmbeddedWindow *window, void *data)
gnc_embedded_window_setup_window (window);
gnc_gobject_tracking_remember(G_OBJECT(window),
G_OBJECT_CLASS(klass));
gnc_gobject_tracking_remember (G_OBJECT(window),
G_OBJECT_CLASS(klass));
LEAVE(" ");
}
@ -274,6 +274,7 @@ gnc_embedded_window_dispose (GObject *object)
ENTER("object %p", object);
window = GNC_EMBEDDED_WINDOW (object);
priv = GNC_EMBEDDED_WINDOW_GET_PRIVATE(window);
if (priv->page)
{
DEBUG("unreffing page %p (count currently %d)", priv->page,
@ -287,30 +288,6 @@ gnc_embedded_window_dispose (GObject *object)
}
static void
gnc_embedded_window_add_widget (GtkUIManager *merge,
GtkWidget *widget,
GncEmbeddedWindow *window)
{
GncEmbeddedWindowPrivate *priv;
ENTER("merge %p, new widget %p, window %p", merge, widget, window);
priv = GNC_EMBEDDED_WINDOW_GET_PRIVATE(window);
if (GTK_IS_TOOLBAR (widget))
{
priv->toolbar = widget;
gtk_toolbar_set_style (GTK_TOOLBAR(priv->toolbar),
GTK_TOOLBAR_BOTH);
gtk_toolbar_set_icon_size (GTK_TOOLBAR(priv->toolbar),
GTK_ICON_SIZE_SMALL_TOOLBAR);
}
gtk_box_pack_start (GTK_BOX (priv->menu_dock), widget, FALSE, FALSE, 0);
gtk_widget_show (widget);
LEAVE(" ");
}
/** Initialize the data structures of a gnucash embedded window.
*
* @param window The object to initialize. */
@ -334,15 +311,7 @@ gnc_embedded_window_setup_window (GncEmbeddedWindow *window)
gtk_widget_show (priv->statusbar);
gtk_box_pack_end (GTK_BOX (window), priv->statusbar, FALSE, TRUE, 0);
window->ui_merge = gtk_ui_manager_new ();
g_signal_connect (G_OBJECT (window->ui_merge), "add_widget",
G_CALLBACK (gnc_embedded_window_add_widget), window);
/* Use the "connect-proxy" signal for tooltip display in the status bar */
g_signal_connect (G_OBJECT (window->ui_merge), "connect-proxy",
G_CALLBACK (gnc_window_connect_proxy), priv->statusbar);
priv->action_group = NULL;
priv->simple_action_group = NULL;
LEAVE(" ");
}
@ -350,7 +319,7 @@ gnc_embedded_window_setup_window (GncEmbeddedWindow *window)
/** Create a new gnc embedded window plugin. */
GncEmbeddedWindow *
gnc_embedded_window_new (const gchar *action_group_name,
GtkActionEntry *action_entries,
GActionEntry *action_entries,
gint n_action_entries,
const gchar *ui_filename,
GtkWidget *enclosing_win,
@ -361,48 +330,61 @@ gnc_embedded_window_new (const gchar *action_group_name,
GncEmbeddedWindow *window;
gchar *ui_fullname;
GError *error = NULL;
guint merge_id;
GtkBuilder *builder;
GtkAccelGroup *accel_group;
ENTER("group %s, first %p, num %d, ui file %s, parent %p, add accelerators %d, user data %p",
action_group_name, action_entries, n_action_entries, ui_filename,
enclosing_win, add_accelerators, user_data);
window = g_object_new (GNC_TYPE_EMBEDDED_WINDOW, NULL);
priv = GNC_EMBEDDED_WINDOW_GET_PRIVATE(window);
/* Determine the full pathname of the ui file */
ui_fullname = gnc_filepath_locate_ui_file (ui_filename);
g_return_val_if_fail (ui_fullname != NULL, NULL);
builder = gtk_builder_new ();
gtk_builder_set_translation_domain (builder, PROJECT_NAME);
ui_fullname = g_strconcat ("/org/gnucash/ui/", ui_filename, NULL);
gtk_builder_add_from_resource (builder, ui_fullname, &error);
if (error)
{
g_critical ("Failed to load, Error %s", error->message);
g_error_free (error);
return NULL; //FIXMEb this may need changing
}
priv->menubar_model = (GMenuModel *)gtk_builder_get_object (builder, "embeddedwin-menu");
priv->menubar = gtk_menu_bar_new_from_model (priv->menubar_model);
gtk_container_add (GTK_CONTAINER(priv->menu_dock), priv->menubar); //FIXMEb this may need changing
gtk_widget_show (GTK_WIDGET(priv->menubar));
priv->toolbar = (GtkWidget *)gtk_builder_get_object (builder, "embeddedwin-toolbar");
g_object_set (priv->toolbar, "toolbar-style", GTK_TOOLBAR_BOTH, NULL);
gtk_container_add (GTK_CONTAINER(priv->menu_dock), GTK_WIDGET(priv->toolbar)); //FIXMEb this may need changing
gtk_widget_show (GTK_WIDGET(priv->toolbar));
g_object_unref (builder);
priv->simple_action_group = g_simple_action_group_new ();
g_action_map_add_action_entries (G_ACTION_MAP(priv->simple_action_group),
action_entries,
n_action_entries,
user_data);
gtk_widget_insert_action_group (GTK_WIDGET(window), "embeddedwin",
G_ACTION_GROUP(priv->simple_action_group));
priv->parent_window = enclosing_win;
/* Create menu and toolbar information */
priv->action_group = gtk_action_group_new (action_group_name);
gtk_action_group_set_translation_domain(priv->action_group, PROJECT_NAME);
gtk_action_group_add_actions (priv->action_group, action_entries,
n_action_entries, user_data);
gtk_ui_manager_insert_action_group (window->ui_merge, priv->action_group, 0);
merge_id = gtk_ui_manager_add_ui_from_file (window->ui_merge, ui_fullname,
&error);
// need to add the accelerator keys
accel_group = gtk_accel_group_new ();
gtk_window_add_accel_group (GTK_WINDOW(enclosing_win), accel_group);
gnc_add_accelerator_keys_for_menu (GTK_WIDGET(priv->menubar), accel_group);
/* Error checking */
g_assert(merge_id || error);
if (error)
{
g_critical("Failed to load ui file.\n Filename %s\n Error %s",
ui_fullname, error->message);
g_error_free(error);
g_free(ui_fullname);
LEAVE("window %p", window);
return window;
}
/* Add accelerators (if wanted) */
if (add_accelerators)
gtk_window_add_accel_group (GTK_WINDOW(enclosing_win),
gtk_ui_manager_get_accel_group(window->ui_merge));
gtk_ui_manager_ensure_update (window->ui_merge);
g_free(ui_fullname);
g_free (ui_fullname);
LEAVE("window %p", window);
return window;
}
@ -446,6 +428,58 @@ gnc_embedded_window_get_statusbar (GncWindow *window_in)
}
/** Retrieve the menu bar associated with an embedded window object.
* This function is called via a vector off a generic window
* interface.
*
* @param window_in A pointer to a generic window. */
static GtkWidget *
gnc_embedded_window_get_menubar (GncWindow *window)
{
GncEmbeddedWindowPrivate *priv;
g_return_val_if_fail (GNC_IS_EMBEDDED_WINDOW(window), NULL);
priv = GNC_EMBEDDED_WINDOW_GET_PRIVATE(window);
return priv->menubar;
}
/** Retrieve the tool bar associated with an embedded window object.
* This function is called via a vector off a generic window
* interface.
*
* @param window_in A pointer to a generic window. */
static GtkWidget *
gnc_embedded_window_get_toolbar (GncWindow *window)
{
GncEmbeddedWindowPrivate *priv;
g_return_val_if_fail (GNC_IS_EMBEDDED_WINDOW(window), NULL);
priv = GNC_EMBEDDED_WINDOW_GET_PRIVATE(window);
return priv->toolbar;
}
/** Retrieve the display hash table associated with an embedded window object.
* This function is called via a vector off a generic window
* interface.
*
* @param window_in A pointer to a generic window. */
static GMenuModel *
gnc_embedded_window_get_menubar_model (GncWindow *window)
{
GncEmbeddedWindowPrivate *priv;
g_return_val_if_fail (GNC_IS_EMBEDDED_WINDOW(window), NULL);
priv = GNC_EMBEDDED_WINDOW_GET_PRIVATE(window);
return priv->menubar_model;
}
/** Initialize the generic window interface for an embedded window.
*
* @param iface A pointer to the interface data structure to
@ -453,6 +487,9 @@ gnc_embedded_window_get_statusbar (GncWindow *window_in)
static void
gnc_window_embedded_window_init (GncWindowIface *iface)
{
iface->get_gtk_window = gnc_embedded_window_get_gtk_window;
iface->get_statusbar = gnc_embedded_window_get_statusbar;
iface->get_gtk_window = gnc_embedded_window_get_gtk_window;
iface->get_statusbar = gnc_embedded_window_get_statusbar;
iface->get_menubar = gnc_embedded_window_get_menubar;
iface->get_toolbar = gnc_embedded_window_get_toolbar;
iface->get_menubar_model = gnc_embedded_window_get_menubar_model;
}

View File

@ -57,9 +57,6 @@ typedef struct
{
/** The parent object for an embedded window. */
GtkBox vbox;
/** A pointer to the UI Manager data structure for the whole
* window. */
GtkUIManager *ui_merge;
} GncEmbeddedWindow;
@ -88,12 +85,12 @@ GType gnc_embedded_window_get_type (void);
* @return A pointer to the new object.
*/
GncEmbeddedWindow *gnc_embedded_window_new (const gchar *action_group_name,
GtkActionEntry *action_entries,
gint n_action_entries,
const gchar *ui_filename,
GtkWidget *enclosing_win,
gboolean add_accelerators,
gpointer user_data);
GActionEntry *action_entries,
gint n_action_entries,
const gchar *ui_filename,
GtkWidget *enclosing_win,
gboolean add_accelerators,
gpointer user_data);
/** Display a data plugin page in a window.

View File

@ -332,3 +332,698 @@ gnc_get_dialog_widget_from_id (GtkDialog *dialog, const gchar *id)
GtkWidget *content_area = gtk_dialog_get_content_area (dialog);
return find_widget_func (content_area, id);
}
/** Disable all the actions in a simple action group
*
* @param action_group The GSimpleActionGroup
*/
void
gnc_disable_all_actions_in_group (GSimpleActionGroup *action_group)
{
gchar **actions;
gint num_actions;
g_return_if_fail (action_group != NULL);
actions = g_action_group_list_actions (G_ACTION_GROUP(action_group));
num_actions = g_strv_length (actions);
// Disable the actions
for (gint i = 0; i < num_actions; i++)
{
GAction *action = g_action_map_lookup_action (G_ACTION_MAP(action_group),
actions[i]);
g_simple_action_set_enabled (G_SIMPLE_ACTION(action), FALSE);
}
g_strfreev (actions);
}
static void
add_accel_for_menu_lookup (GtkWidget *widget, gpointer user_data)
{
if (GTK_IS_MENU_ITEM(widget))
{
GtkMenuItem* menuItem = GTK_MENU_ITEM(widget);
GtkWidget* subMenu = gtk_menu_item_get_submenu (menuItem);
GtkWidget *accel_label = gtk_bin_get_child (GTK_BIN(widget));
if (accel_label)
{
guint key;
GdkModifierType mods;
gtk_accel_label_get_accel (GTK_ACCEL_LABEL(accel_label), &key, &mods);
if (key > 0)
gtk_widget_add_accelerator (GTK_WIDGET(widget), "activate",
GTK_ACCEL_GROUP(user_data),
key, mods, GTK_ACCEL_VISIBLE);
}
if (GTK_IS_CONTAINER(subMenu))
gtk_container_foreach (GTK_CONTAINER(subMenu),
add_accel_for_menu_lookup, user_data);
}
}
/** Add accelerator keys for menu item widgets
*
* @param menu The menu widget.
*
* @param accel_group The accelerator group to use.
*/
void
gnc_add_accelerator_keys_for_menu (GtkWidget *menu, GtkAccelGroup *accel_group)
{
g_return_if_fail (GTK_IS_WIDGET(menu));
g_return_if_fail (accel_group != NULL);
gtk_container_foreach (GTK_CONTAINER(menu), add_accel_for_menu_lookup, accel_group);
}
static gpointer
find_menu_item_func (GtkWidget *widget, const gchar *action_name, const gchar *action_label)
{
GtkWidget *ret = NULL;
if (GTK_IS_MENU_ITEM(widget))
{
GtkWidget* subMenu;
if (action_name)
{
if (GTK_IS_ACTIONABLE(widget))
{
const gchar *a_name = gtk_actionable_get_action_name (GTK_ACTIONABLE(widget));
if (g_strcmp0 (a_name, action_name) == 0)
return widget;
}
}
if (action_label)
{
GtkWidget *accel_label = gtk_bin_get_child (GTK_BIN(widget));
if (accel_label)
{
// use gtk_label_get_text to get text with no underlines
const gchar *al_name = gtk_label_get_label (GTK_LABEL(accel_label));
if (g_strcmp0 (al_name, action_label) == 0)
return widget;
}
}
subMenu = gtk_menu_item_get_submenu (GTK_MENU_ITEM(widget));
if (GTK_IS_CONTAINER(subMenu))
{
GList *container_list = gtk_container_get_children (GTK_CONTAINER(subMenu));
for (GList *n = container_list; !ret && n; n = n->next)
ret = find_menu_item_func (n->data, action_name, action_label);
g_list_free (container_list);
}
}
return ret;
}
/** Search the menu for the menu item based on action name
*
* @param menu The menu widget.
*
* @param action_name The GAction name.
*
* @return The menu item widget or NULL.
*/
GtkWidget *
gnc_find_menu_item_by_action_name (GtkWidget *menu, const gchar *action_name)
{
GtkWidget *ret = NULL;
const gchar *action_label = NULL;
g_return_val_if_fail (GTK_IS_WIDGET(menu), NULL);
g_return_val_if_fail (action_name != NULL, NULL);
if (GTK_IS_CONTAINER(menu))
{
GList *container_list = gtk_container_get_children (GTK_CONTAINER(menu));
for (GList *n = container_list; !ret && n; n = n->next)
ret = find_menu_item_func (n->data, action_name, action_label);
g_list_free (container_list);
}
return ret;
}
/** Search the menu for the menu item based on the action label
*
* @param menu The menu widget.
*
* @param action_label The GtkMenuItem label.
*
* @return The menu item widget or NULL.
*/
GtkWidget *
gnc_find_menu_item_by_action_label (GtkWidget *menu, const gchar *action_label)
{
GtkWidget *ret = NULL;
const gchar *action_name = NULL;
g_return_val_if_fail (GTK_IS_WIDGET(menu), NULL);
g_return_val_if_fail (action_label != NULL, NULL);
if (GTK_IS_CONTAINER(menu))
{
GList *container_list = gtk_container_get_children (GTK_CONTAINER(menu));
for (GList *n = container_list; !ret && n; n = n->next)
ret = find_menu_item_func (n->data, action_name, action_label);
g_list_free (container_list);
}
return ret;
}
static void
menu_item_list (GtkWidget *widget, gpointer user_data)
{
GList **list = user_data;
if (GTK_IS_MENU_ITEM(widget))
{
GtkWidget* subMenu = gtk_menu_item_get_submenu (GTK_MENU_ITEM(widget));
*list = g_list_prepend (*list, widget);
if (GTK_IS_CONTAINER(subMenu))
gtk_container_foreach (GTK_CONTAINER(subMenu),
menu_item_list, user_data);
}
}
/** Return a list of GtkMenuItems
*
* @param menu The menu widget.
*
* @return A GList of menu items or NULL.
*/
GList *
gnc_menu_get_items (GtkWidget *menu)
{
GList *list = NULL;
g_return_val_if_fail (GTK_IS_WIDGET(menu), NULL);
gtk_container_foreach (GTK_CONTAINER(menu), menu_item_list, &list);
return list;
}
struct find_tool_item_struct
{
GtkWidget *found_tool_item;
const gchar *action_name;
};
static void
find_tool_action (GtkWidget *widget, gpointer user_data)
{
struct find_tool_item_struct *ftis = user_data;
if (GTK_IS_ACTIONABLE(widget))
{
// this returns the full action name
const gchar *item_action_name = gtk_actionable_get_action_name (GTK_ACTIONABLE(widget));
if (g_str_has_suffix (item_action_name, ftis->action_name))
ftis->found_tool_item = GTK_WIDGET(widget);
}
}
/** Search the toolbar for the tool item based on the action name
*
* @param toolbar The toolbar widget.
*
* @param action_name The GAction name.
*
* @return The tool item widget or NULL.
*/
GtkWidget *
gnc_find_toolbar_item (GtkWidget *toolbar, const gchar *action_name)
{
struct find_tool_item_struct ftis;
g_return_val_if_fail (GTK_IS_TOOLBAR(toolbar), NULL);
g_return_val_if_fail (action_name != NULL, NULL);
ftis.action_name = action_name;
ftis.found_tool_item = NULL;
gtk_container_foreach (GTK_CONTAINER(toolbar), find_tool_action, &ftis);
return ftis.found_tool_item;
}
static void
extract_items_from_model (GMenuModel *model,
gint item,
gpointer user_data)
{
GMenuAttributeIter *iter;
const gchar *key;
GVariant *value;
GncMenuModelSearch *gsm = user_data;
const gchar *action = NULL;
const gchar *label = NULL;
const gchar *tooltip = NULL;
iter = g_menu_model_iterate_item_attributes (model, item);
while (g_menu_attribute_iter_get_next (iter, &key, &value))
{
if (g_str_equal (key, GNC_MENU_ATTRIBUTE_TOOLTIP) &&
g_variant_is_of_type (value, G_VARIANT_TYPE_STRING))
tooltip = g_variant_get_string (value, NULL);
else if (g_str_equal (key, G_MENU_ATTRIBUTE_LABEL) &&
g_variant_is_of_type (value, G_VARIANT_TYPE_STRING))
label = g_variant_get_string (value, NULL);
else if (g_str_equal (key, G_MENU_ATTRIBUTE_ACTION) &&
g_variant_is_of_type (value, G_VARIANT_TYPE_STRING))
action = g_variant_get_string (value, NULL);
g_variant_unref (value);
}
if (action && gsm->search_action_name)
{
if (g_str_has_suffix (action, gsm->search_action_name))
{
gsm->model = model;
gsm->index = item;
gsm->tooltip = tooltip;
gsm->search_action_label = label;
}
}
if (label && gsm->search_action_label)
{
if (g_strcmp0 (label, gsm->search_action_label) == 0)
{
gsm->model = model;
gsm->index = item;
gsm->tooltip = tooltip;
gsm->search_action_name = action;
}
}
g_object_unref (iter);
}
static void
items_from_model (GMenuModel *model,
gpointer user_data)
{
GncMenuModelSearch *gsm = user_data;
for (gint i = 0; i < g_menu_model_get_n_items (model); i++)
{
GMenuLinkIter *iter;
GMenuModel *sub_model;
if (gsm->model)
return;
extract_items_from_model (model, i, user_data);
iter = g_menu_model_iterate_item_links (model, i);
while (g_menu_link_iter_get_next (iter, NULL, &sub_model))
{
items_from_model (sub_model, user_data);
g_object_unref (sub_model);
}
g_object_unref (iter);
}
}
/** Find a GtkMenu item from the action name. This is done by first finding
* the action name in the GMenuModel and then doing a search for the
* label text in the GtkMenu.
*
* NOTE: This is done this way as the action_name field of the GtkMenuItem
* is not populated from the model.
*
* @param menu_model The GMenuModel of the menu.
*
* @param gsm The GncMenuModelSearch structure.
*
* @return TRUE if GMenuModel item found or FALSE if not.
*/
gboolean
gnc_menubar_model_find_item (GMenuModel *menu_model, GncMenuModelSearch *gsm)
{
g_return_val_if_fail (menu_model != NULL, FALSE);
g_return_val_if_fail (gsm != NULL, FALSE);
gsm->model = NULL;
items_from_model (menu_model, gsm);
if (gsm->model)
return TRUE;
return FALSE;
}
/** Find a GtkMenu item from the action name. This is done by first finding
* the action name in the GMenuModel and then doing a search for the
* label text in the GtkMenu.
*
* NOTE: This is done this way as the action_name field of the GtkMenuItem
* is not populated from the model.
*
* @param menu_model The GMenuModel of the menu.
*
* @param menu The GtkMenu built from the model.
*
* @param action_name The action name of the menu item to find.
*
* @return The GtkMenuItem if found or NULL
*/
GtkWidget *
gnc_menubar_model_find_menu_item (GMenuModel *menu_model, GtkWidget *menu, const gchar *action_name)
{
GncMenuModelSearch *gsm;
GtkWidget *menu_item = NULL;
g_return_val_if_fail (menu_model != NULL, NULL);
g_return_val_if_fail (menu != NULL, NULL);
g_return_val_if_fail (action_name != NULL, NULL);
gsm = g_new0 (GncMenuModelSearch, 1);
gsm->search_action_label = NULL;
gsm->search_action_name = action_name;
if (gnc_menubar_model_find_item (menu_model, gsm))
menu_item = gnc_find_menu_item_by_action_label (menu, gsm->search_action_label);
g_free (gsm);
return menu_item;
}
/** Update the GMenuModel item based on the action name by copying
* existing item, removing it and inserting a new one in same location.
*
* @param menu_model The GMenuModel of the menu.
*
* @param action_name The action name to update.
*
* @param label The new menu label text.
*
* @param tooltip The new tooltip text if any.
*
* @return TRUE if item found and updated or FALSE if not.
*/
gboolean
gnc_menubar_model_update_item (GMenuModel *menu_model, const gchar *action_name,
const gchar *label, const gchar *tooltip)
{
GncMenuModelSearch *gsm;
GtkWidget *menu_item = NULL;
gboolean found = FALSE;
g_return_val_if_fail (menu_model != NULL, FALSE);
g_return_val_if_fail (action_name != NULL, FALSE);
g_return_val_if_fail (label != NULL, FALSE);
gsm = g_new0 (GncMenuModelSearch, 1);
gsm->search_action_label = NULL;
gsm->search_action_name = action_name;
if (gnc_menubar_model_find_item (menu_model, gsm))
{
GMenuAttributeIter *iter;
const gchar *key;
GVariant *value;
GVariant *old_target = NULL;
const gchar *old_action = NULL;
const gchar *old_label = NULL;
const gchar *old_temp = NULL;
const gchar *old_accel = NULL;
GMenuItem *item;
iter = g_menu_model_iterate_item_attributes (gsm->model, gsm->index);
while (g_menu_attribute_iter_get_next (iter, &key, &value))
{
if (g_str_equal (key, GNC_MENU_ATTRIBUTE_TEMPORARY) &&
g_variant_is_of_type (value, G_VARIANT_TYPE_STRING))
old_temp = g_variant_get_string (value, NULL);
else if (g_str_equal (key, G_MENU_ATTRIBUTE_LABEL) &&
g_variant_is_of_type (value, G_VARIANT_TYPE_STRING))
old_label = g_variant_get_string (value, NULL);
else if (g_str_equal (key, G_MENU_ATTRIBUTE_ACTION) &&
g_variant_is_of_type (value, G_VARIANT_TYPE_STRING))
old_action = g_variant_get_string (value, NULL);
else if (g_str_equal (key, GNC_MENU_ATTRIBUTE_ACCELERATOR) &&
g_variant_is_of_type (value, G_VARIANT_TYPE_STRING))
old_accel = g_variant_get_string (value, NULL);
else if (g_str_equal (key, G_MENU_ATTRIBUTE_TARGET))
old_target = g_variant_ref (value);
g_variant_unref (value);
}
item = g_menu_item_new (label, old_action);
if (tooltip)
g_menu_item_set_attribute (item, GNC_MENU_ATTRIBUTE_TOOLTIP, "s", tooltip);
if (old_temp)
g_menu_item_set_attribute (item, GNC_MENU_ATTRIBUTE_TEMPORARY, "s", old_temp);
if (old_accel)
g_menu_item_set_attribute (item, GNC_MENU_ATTRIBUTE_ACCELERATOR, "s", old_accel);
if (old_target)
{
g_menu_item_set_attribute_value (item, G_MENU_ATTRIBUTE_TARGET, old_target);
g_variant_unref (old_target);
}
g_menu_remove (G_MENU(gsm->model), gsm->index);
g_menu_insert_item (G_MENU(gsm->model), gsm->index, item);
found = TRUE;
}
g_free (gsm);
return found;
}
typedef struct
{
GMenuModel *model;
gint index;
} to_remove;
static void
item_to_remove_from_model (GMenuModel *model,
gint item,
GList **remove_list,
const gchar *attrib)
{
GVariant *value = g_menu_model_get_item_attribute_value (model, item,
attrib, NULL);
if (value && g_variant_is_of_type (value, G_VARIANT_TYPE_STRING))
{
to_remove *tr = g_new0 (to_remove, 1);
tr->model = model;
tr->index = item;
// to keep the order append
*remove_list = g_list_append (*remove_list, tr);
g_variant_unref (value);
}
}
static void
remove_items_from_model (GMenuModel *model,
GList **remove_list,
const gchar *attrib)
{
// Note: item high to low
for (gint i = g_menu_model_get_n_items (model) -1; i >= 0; i--)
{
GMenuLinkIter *iter;
GMenuModel *sub_model;
item_to_remove_from_model (model, i, remove_list, attrib);
iter = g_menu_model_iterate_item_links (model, i);
while (g_menu_link_iter_get_next (iter, NULL, &sub_model))
{
remove_items_from_model (sub_model, remove_list, attrib);
g_object_unref (sub_model);
}
g_object_unref (iter);
}
}
static void
remove_items (gpointer data, gpointer user_data)
{
to_remove *tr = (to_remove*)data;
g_menu_remove (G_MENU(tr->model), tr->index);
g_free (tr);
}
/** Remove GMenuModel entries based on having an attribute value equal
* to attrib, it does not matter what the value is.
*
* @param menu_model The GMenuModel of the menu.
*
* @param attrib The attribute to look for.
*/
void
gnc_menubar_model_remove_items_with_attrib (GMenuModel *menu_model, const gchar *attrib)
{
GList *remove_list = NULL;
g_return_if_fail (menu_model != NULL);
g_return_if_fail (attrib != NULL);
remove_items_from_model (menu_model, &remove_list, attrib);
g_list_foreach (remove_list, (GFunc)remove_items, NULL);
g_list_free (remove_list);
}
static void
statusbar_push (GtkWidget *statusbar, const gchar *text)
{
gtk_statusbar_push (GTK_STATUSBAR(statusbar), 0,
text ? text : " ");
}
static void
statusbar_pop (GtkWidget *statusbar)
{
gtk_statusbar_pop (GTK_STATUSBAR(statusbar), 0);
}
static void
menu_item_select_cb (GtkWidget *menu_item, GtkWidget *statusbar)
{
GtkWidget *accel_label = gtk_bin_get_child (GTK_BIN(menu_item));
GMenuModel *menubar_model = g_object_get_data (G_OBJECT(statusbar), "menu-model");
if (!menubar_model)
return;
if (accel_label)
{
GncMenuModelSearch *gsm = g_new0 (GncMenuModelSearch, 1);
gsm->search_action_label = gtk_label_get_label (GTK_LABEL(accel_label));
gsm->search_action_name = NULL;
if (gnc_menubar_model_find_item (menubar_model, gsm))
{
if (gsm->model)
statusbar_push (statusbar, gsm->tooltip);
}
g_free (gsm);
}
}
static void
menu_item_deselect_cb (GtkWidget *menu_item, GtkWidget *statusbar)
{
statusbar_pop (statusbar);
}
/** Setup the callbacks for menu bar items so the tooltip can be
* displayed in the status bar.
*
* @param menu_item The menubar menu item widget.
*
* @param statusbar The statusbar widget to display the tooltip.
*/
void
gnc_menu_item_setup_tooltip_to_statusbar_callback (GtkWidget *menu_item,
GtkWidget *statusbar)
{
g_return_if_fail (menu_item != NULL);
g_return_if_fail (statusbar != NULL);
if (GPOINTER_TO_INT(g_object_get_data(G_OBJECT(menu_item), "added-callbacks")))
return;
g_signal_connect (menu_item, "select",
G_CALLBACK(menu_item_select_cb),
statusbar);
g_signal_connect (menu_item, "deselect",
G_CALLBACK(menu_item_deselect_cb),
statusbar);
g_object_set (G_OBJECT(menu_item), "has-tooltip", FALSE, NULL);
g_object_set_data (G_OBJECT(menu_item), "added-callbacks", GINT_TO_POINTER(1));
}
static gboolean
tool_item_enter_event (GtkWidget *button, GdkEvent *event,
gpointer user_data)
{
GtkWidget *tool_item = gtk_widget_get_parent (button);
gchar *tooltip = gtk_widget_get_tooltip_text (tool_item);
statusbar_push (user_data, tooltip);
g_free (tooltip);
return FALSE;
}
static gboolean
tool_item_leave_event (GtkWidget *button, GdkEvent *event,
gpointer user_data)
{
statusbar_pop (user_data);
return FALSE;
}
/** Setup the callbacks for tool bar items so the tooltip can be
* displayed in the status bar.
*
* @param tool_item The toolbar tool item widget.
*
* @param statusbar The statusbar widget to display the tooltip.
*/
void
gnc_tool_item_setup_tooltip_to_statusbar_callback (GtkWidget *tool_item,
GtkWidget *statusbar)
{
GtkWidget *child;
g_return_if_fail (tool_item != NULL);
g_return_if_fail (statusbar != NULL);
child = gtk_bin_get_child (GTK_BIN(tool_item));
gtk_widget_add_events (GTK_WIDGET(child),
GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK
| GDK_FOCUS_CHANGE_MASK);
g_signal_connect (child, "enter-notify-event",
G_CALLBACK (tool_item_enter_event),
statusbar);
g_signal_connect (child, "leave-notify-event",
G_CALLBACK (tool_item_leave_event),
statusbar);
g_object_set (G_OBJECT(tool_item), "has-tooltip", FALSE, NULL);
}

View File

@ -41,6 +41,10 @@
@{
*/
#define GNC_MENU_ATTRIBUTE_ACCELERATOR "accel"
#define GNC_MENU_ATTRIBUTE_TOOLTIP "tooltip"
#define GNC_MENU_ATTRIBUTE_TEMPORARY "temp"
void gnc_cbwe_set_by_string(GtkComboBox *cbwe, const gchar *text);
void gnc_cbwe_add_completion (GtkComboBox *cbwe);
void gnc_cbwe_require_list_item (GtkComboBox *cbwe);
@ -55,6 +59,41 @@ void gnc_style_context_get_border_color (GtkStyleContext *context,
GtkWidget *gnc_get_dialog_widget_from_id (GtkDialog *dialog, const gchar *id);
void gnc_disable_all_actions_in_group (GSimpleActionGroup *action_group);
void gnc_add_accelerator_keys_for_menu (GtkWidget *menu, GtkAccelGroup *accel_group);
GtkWidget *gnc_find_menu_item_by_action_name (GtkWidget *menu, const gchar *action_name);
GtkWidget *gnc_find_menu_item_by_action_label (GtkWidget *menu, const gchar *action_label);
GList *gnc_menu_get_items (GtkWidget *menu);
GtkWidget *gnc_find_toolbar_item (GtkWidget *toolbar, const gchar *action_name);
void gnc_menu_item_setup_tooltip_to_statusbar_callback (GtkWidget *menu_item,
GtkWidget *statusbar);
void gnc_tool_item_setup_tooltip_to_statusbar_callback (GtkWidget *tool_item,
GtkWidget *statusbar);
struct _GncMenuModelSearch
{
const gchar *search_action_name;
const gchar *search_action_label;
const gchar *tooltip;
GMenuModel *model;
gint index;
};
typedef struct _GncMenuModelSearch GncMenuModelSearch;
gboolean gnc_menubar_model_find_item (GMenuModel *menu_model, GncMenuModelSearch *gsm);
GtkWidget *gnc_menubar_model_find_menu_item (GMenuModel *menu_model, GtkWidget *menu, const gchar *action_name);
gboolean gnc_menubar_model_update_item (GMenuModel *menu_model, const gchar *action_name,
const gchar *label, const gchar *tooltip);
void gnc_menubar_model_remove_items_with_attrib (GMenuModel *menu_model, const gchar *attrib);
/** @} */
#endif /* GNC_GTK_UTILS_H */

File diff suppressed because it is too large Load Diff

View File

@ -55,27 +55,32 @@ extern "C"
/* typedefs & structures */
typedef struct
{
const gchar *actions;
const gchar *update_type;
} GncMenuUpdate;
/** The instance data structure for a main window object. */
typedef struct GncMainWindow
{
GtkWindow gtk_window; /**< The parent object for a main window. */
GtkUIManager *ui_merge; /**< A pointer to the UI Manager data
structure for the whole window. */
gboolean window_quitting; /**< Set to TRUE when quitting from this window. */
gboolean just_plugin_prefs; /**< Just remove preferences only from plugins */
GtkApplicationWindow gtk_application_window; /**< The parent object for a main window. */
gboolean window_quitting; /**< Set to TRUE when quitting from this window. */
gboolean just_plugin_prefs; /**< Just remove preferences only from plugins */
} GncMainWindow;
/** The class data structure for a main window object. */
typedef struct
{
GtkWindowClass gtk_window; /**< The parent class for a
main window. */
GtkApplicationWindowClass gtk_application_window; /**< The parent class for a main window. */
/* callbacks */
void (*page_added) (GncMainWindow *window,
GncPluginPage *page);
void (*page_changed) (GncMainWindow *window,
GncPluginPage *page);
void (*menu_changed) (GncMainWindow *window,
GncPluginPage *page); //FIXMEb added
} GncMainWindowClass;
typedef struct
@ -137,12 +142,12 @@ void gnc_main_window_open_page (GncMainWindow *window,
void gnc_main_window_close_page (GncPluginPage *page);
/* Iterator function to walk all pages in all windows, calling the
* specified function for each page.
/** Iterator function to walk all pages in all windows, calling the
* specified function for each page.
*
* @param entry A pointer to the function to be called.
* @param entry A pointer to the function to be called.
*
* @param user_data A data pointer passed to each call of the function.
* @param user_data A data pointer passed to each call of the function.
*/
void gnc_main_window_foreach_page (GncMainWindowPageFunc fn,
gpointer user_data);
@ -164,12 +169,6 @@ void gnc_main_window_foreach_page (GncMainWindowPageFunc fn,
*/
GncPluginPage *gnc_main_window_get_current_page (GncMainWindow *window);
/** Returns the pointer to the GtkUIManager which is used for the menu
* item merging. */
GtkUIManager *gnc_main_window_get_uimanager (GncMainWindow *window);
/** Update the name of the page in the main window.
*
* @param page The page to be updated.
@ -179,7 +178,6 @@ void
main_window_update_page_name (GncPluginPage *page,
const gchar *name_in);
/** Update the color on the page tabs in the main window.
*
* @param page The page to be updated.
@ -211,16 +209,11 @@ main_window_update_page_set_read_only_icon (GncPluginPage *page,
* should be unique among all groups added to the window, and will be
* needed to remove the actions from this window.
*
* @param group A pointer to an array of GtkActions. These are the
* actions that will be added to the user interface.
*
* @param merge_id A merge identifier retrieved from a call to
* gtk_ui_manager_new_merge_id().
* @param group A pointer to the GSimpleActionGroup.
*/
void gnc_main_window_manual_merge_actions (GncMainWindow *window,
const gchar *group_name,
GtkActionGroup *group,
guint merge_id);
const gchar *group_name,
GSimpleActionGroup *group);
/** Add a set of actions to the specified window. This function
@ -236,16 +229,11 @@ void gnc_main_window_manual_merge_actions (GncMainWindow *window,
* should be unique among all groups added to the window, and will be
* needed to remove the actions from this window.
*
* @param entries A pointer to an array of GtkActionEntry. These
* @param entries A pointer to an array of GActionEntry. These
* are the actions that will be added to the user interface.
*
* @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 n_toggle_entries The number of toggle actions in the array.
*
* @param filename The filename containing the user interface
* definition that goes with this set of actions.
*
@ -254,11 +242,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,
const gchar *filename,
const gchar **ui_updates,
const gchar *ui_filename,
gpointer user_data);
@ -276,18 +263,99 @@ void gnc_main_window_merge_actions (GncMainWindow *window,
void gnc_main_window_unmerge_actions (GncMainWindow *window,
const gchar *group_name);
/** Force a full update of the user interface for the specified
* window. This can be an expensive function, but is needed because
* the gtk ui manager doesn't always seem to update properly when
* actions are changed.
/** Show or hide menu and toolbar items based on a NULL terminated
* list of action names
*
* @param window A pointer to the window whose user interface should
* be updated.
*
* @attention Is this function still needed?
* @param action_names A NULL terminated list of actions names that
* should be modified.
*
* @param vis Whether to show or hide the widget items
*/
void gnc_main_window_actions_updated (GncMainWindow *window);
void gnc_main_window_set_vis_of_items_by_action (GncMainWindow *window,
const gchar **action_names,
gboolean vis); //FIXMEb added
/** Find the menu item with the given action name for the window
* specified.
*
* @param window A pointer to the window whose user interface should
* be updated.
*
* @param action_name The action name of the tool item to find.
*
* @return The found menu item widget or NULL.
*/
GtkWidget *gnc_main_window_menu_find_menu_item (GncMainWindow *window,
const gchar *action_name); //FIXMEb added
/** Find the toolbar item with the given action name for the window
* specified.
*
* @param window A pointer to the window whose user interface should
* be updated.
*
* @param action_name The action name of the tool item to find.
*
* @return The found tool item widget or NULL.
*/
GtkWidget * gnc_main_window_toolbar_find_tool_item (GncMainWindow *window,
const gchar *action_name); //FIXMEb added
/** Find the GMenuModel item given the action name for the window
* specified.
*
* @param window A pointer to the window whose user interface should
* be updated.
*
* @param action_name The action name of the menu item to find.
*
* @param label The new label for the menu item.
*
* @param tooltip The new tooltip for the menu item, optional.
*
* @return TRUE if menu item found and updated or FALSE.
*/
gboolean gnc_main_window_update_menu_for_action (GncMainWindow *window,
const gchar *action_name,
const gchar *label,
const gchar *tooltip); //FIXMEb added
/** Scan the main window menu and add accelerator keys to main window
* accelerator group.
*
* @param window A pointer to the window whose user interface should
* be updated.
*
*/
void gnc_main_window_menu_add_accelerator_keys (GncMainWindow *window); //FIXMEb added
/** A structure for defining alternate action names for use in the
* toolbar. All toolbar buttons are homogeneous in size and are sized
* to fit the longest label. Therefore, this structure should be
* used if an action name is more than one word. This way the menu
* can have the label "Whizzy Feature", while the toolbar button only
* has the label "Whizzy". */
typedef struct
{
/** The name of the action. */
const char *action_name;
/** The alternate toolbar label to use */
const char *short_label;
} GncToolBarShortNames; //FIXMEb added
/** Update the labels of the toolbar items with short names.
*
* @param window The window that conatins a tool bar to update.
*
* @param toolbar_labels A pointer to a NULL terminated array of data
* GncToolBarShortNames items.
*/
void gnc_main_window_init_short_names (GncMainWindow *window,
GncToolBarShortNames *toolbar_labels); //FIXMEb added
/** Retrieve a specific set of user interface actions from a window.
@ -299,12 +367,12 @@ void gnc_main_window_actions_updated (GncMainWindow *window);
* @param group_name The name of a set of actions. This must be a
* name provided when the actions were installed.
*
* @return A pointer to a GtkActionGroup that was added with the
* @return A pointer to a GSimpleActionGroup that was added with the
* 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
@ -414,17 +482,53 @@ gboolean gnc_main_window_all_finish_pending (void);
* this action. */
void gnc_main_window_all_action_set_sensitive (const gchar *action_name, gboolean sensitive);
/** Find action in main window.
/** Find the GAction in the main window.
*
* @param window The window which should be checked for the action.
*
* @param name The name of the command to be retrieved.
* @param action_name The name of the command to be retrieved.
*
* @return A pointer to a GtkAction that was added with the
* @return A pointer to a GAction that was added with the
* 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 *action_name);
/** Find the GAction in a specific action group for window.
*
* @param window The window which should be checked for the action.
*
* @param group_name The name of the action group to search.
*
* @param name The name of the command to be retrieved.
*
* @return A pointer to the GAction if found or NULL will be returned.
*/
GAction *gnc_main_window_find_action_in_group (GncMainWindow *window,
const gchar *group_name,
const gchar *action_name); //FIXMEb added
/** Return the GMenuModel for the main window menu bar.
*
* @param window The window for the menu bar.
*
* @return The GMenuModel or NULL.
*/
GMenuModel *gnc_main_window_get_menu_model (GncMainWindow *window); //FIXMEb added
/** Update the main window menu with the placeholders listed in
* ui_updates and load the page specific toolbar.
*
* @param window The window which should be checked for the action.
*
* @param page The plugin page calling this function.
*
* @param ui_updates A NULL terminated list of placeholders to load
*/
void gnc_main_window_update_menu_and_toolbar (GncMainWindow *window,
GncPluginPage *page,
const gchar **ui_updates); //FIXMEb added
/**
* Shows all main windows.

View File

@ -74,7 +74,7 @@ initialize_getters()
static gboolean
gnc_extension_type (SCM extension, GtkUIManagerItemType *type)
gnc_extension_type (SCM extension, GNCMenuItemTypes *type)
{
char *string;
@ -89,15 +89,15 @@ gnc_extension_type (SCM extension, GtkUIManagerItemType *type)
if (g_strcmp0(string, "menu-item") == 0)
{
*type = GTK_UI_MANAGER_MENUITEM;
*type = GNC_MENU_ITEM;
}
else if (g_strcmp0(string, "menu") == 0)
{
*type = GTK_UI_MANAGER_MENU;
*type = GNC_SUB_MENU_ITEM;
}
else if (g_strcmp0(string, "separator") == 0)
{
*type = GTK_UI_MANAGER_SEPARATOR;
*type = GNC_SEPARATOR_ITEM;
}
else
{
@ -261,10 +261,10 @@ gnc_create_extension_info (SCM extension)
gchar* name;
gchar* guid;
ext_info = g_new0(ExtensionInfo, 1);
ext_info = g_new0 (ExtensionInfo, 1);
ext_info->extension = extension;
gnc_extension_path(extension, &ext_info->path);
if (!gnc_extension_type( extension, &ext_info->type ))
gnc_extension_path (extension, &ext_info->path);
if (!gnc_extension_type (extension, &ext_info->type))
{
/* Can't parse the type passed to us. Bail now. */
g_free(ext_info);
@ -272,29 +272,29 @@ gnc_create_extension_info (SCM extension)
}
/* Get all the pieces */
name = gnc_extension_name(extension);
guid = gnc_extension_guid(extension);
ext_info->ae.label = g_strdup(gettext(name));
ext_info->ae.name = gnc_ext_gen_action_name(guid);
ext_info->ae.tooltip = gnc_extension_documentation(extension);
ext_info->ae.stock_id = NULL;
ext_info->ae.accelerator = NULL;
ext_info->ae.callback = NULL;
g_free(name);
g_free(guid);
name = gnc_extension_name (extension);
guid = gnc_extension_guid (extension);
ext_info->action_label = g_strdup (gettext (name));
ext_info->action_name = gnc_ext_gen_action_name (guid);
ext_info->action_tooltip = gnc_extension_documentation (extension);
g_free (name);
g_free (guid);
tmp = g_strdup_printf("%s/%s", ext_info->path, ext_info->ae.label);
ext_info->sort_key = g_utf8_collate_key(tmp, -1);
tmp = g_strdup_printf ("%s/%s", ext_info->path, ext_info->action_label);
ext_info->sort_key = g_utf8_collate_key (tmp, -1);
g_free(tmp);
switch (ext_info->type)
{
case GTK_UI_MANAGER_MENU:
case GNC_SUB_MENU_ITEM:
typeStr = "menu";
break;
case GTK_UI_MANAGER_MENUITEM:
case GNC_MENU_ITEM:
typeStr = "menuitem";
break;
case GNC_SEPARATOR_ITEM:
typeStr = "sepitem";
break;
default:
typeStr = "unk";
break;
@ -302,31 +302,31 @@ gnc_create_extension_info (SCM extension)
ext_info->typeStr = typeStr;
DEBUG( "extension: %s/%s [%s] tip [%s] type %s\n",
ext_info->path, ext_info->ae.label, ext_info->ae.name,
ext_info->ae.tooltip, ext_info->typeStr );
ext_info->path, ext_info->action_label, ext_info->action_name,
ext_info->action_tooltip, ext_info->typeStr );
scm_gc_protect_object(extension);
scm_gc_protect_object (extension);
/* need to append so we can run them in order */
extension_list = g_slist_append(extension_list, ext_info);
extension_list = g_slist_append (extension_list, ext_info);
return TRUE;
}
static void
cleanup_extension_info(gpointer extension_info, gpointer not_used)
cleanup_extension_info (gpointer extension_info, gpointer not_used)
{
ExtensionInfo *ext_info = extension_info;
if (ext_info->extension)
scm_gc_unprotect_object(ext_info->extension);
scm_gc_unprotect_object (ext_info->extension);
g_free(ext_info->sort_key);
g_free((gchar *)ext_info->ae.name);
g_free((gchar *)ext_info->ae.label);
g_free((gchar *)ext_info->ae.tooltip);
g_free(ext_info->path);
g_free(ext_info);
g_free (ext_info->sort_key);
g_free ((gchar *)ext_info->action_name);
g_free ((gchar *)ext_info->action_label);
g_free ((gchar *)ext_info->action_tooltip);
g_free (ext_info->path);
g_free (ext_info);
}

View File

@ -25,21 +25,29 @@
#include <libguile.h>
typedef enum
{
GNC_MENU_ITEM,
GNC_SUB_MENU_ITEM,
GNC_SEPARATOR_ITEM,
} GNCMenuItemTypes;
typedef struct _ExtensionInfo
{
SCM extension;
GtkActionEntry ae;
gchar *action_label;
gchar *action_name;
gchar *action_tooltip;
gchar *path;
gchar *sort_key;
const gchar *typeStr;
GtkUIManagerItemType type;
GNCMenuItemTypes type;
gboolean accel_assigned;
} ExtensionInfo;
#define ADDITIONAL_MENUS_PLACEHOLDER "AdditionalMenusPlaceholder"
GSList *gnc_extensions_get_menu_list (void);
void gnc_extension_invoke_cb (SCM extension, SCM window);
@ -49,11 +57,11 @@ void gnc_extension_invoke_cb (SCM extension, SCM window);
* @param extension A scheme object describing the menu to be
* inserted. Functions written in C should use the gnc-plugin code.
*/
void gnc_add_scm_extension(SCM extension);
void gnc_add_scm_extension (SCM extension);
/** This function releases any memory being held by the 'extensions'
* code. It is called from the window shutdown code.
*/
void gnc_extensions_shutdown(void);
void gnc_extensions_shutdown (void);
#endif

View File

@ -44,6 +44,7 @@
#include "gnc-engine.h"
#include "gnc-prefs.h"
#include "gnc-uri-utils.h"
#include "gnc-gtk-utils.h"
static GObjectClass *parent_class = NULL;
@ -65,12 +66,12 @@ static void gnc_plugin_file_history_remove_from_window (GncPlugin *plugin, GncMa
static QofLogModule log_module = GNC_MOD_GUI;
/* Command callbacks */
static void gnc_plugin_file_history_cmd_open_file (GtkAction *action, GncMainWindowActionData *data);
static void gnc_plugin_file_history_cmd_open_file (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
/** The label given to the main window for this plugin. */
#define PLUGIN_ACTIONS_NAME "gnc-plugin-file-history-actions"
/** The name of the UI description file for this plugin. */
#define PLUGIN_UI_FILENAME "gnc-plugin-file-history-ui.xml"
#define PLUGIN_UI_FILENAME "gnc-plugin-file-history.ui"
#define GNOME1_HISTORY "History"
#define GNOME1_MAXFILES "MaxFiles"
@ -80,22 +81,28 @@ static void gnc_plugin_file_history_cmd_open_file (GtkAction *action, GncMainWin
* will be updated to reflect the users recent choices. This list is
* limited to ten actions, although there may be a smaller limit set
* by the user. The typical limit is four. */
static GtkActionEntry gnc_plugin_actions [] =
static GActionEntry gnc_plugin_actions [] =
{
{ "RecentFile0Action", NULL, "", NULL, NULL, G_CALLBACK (gnc_plugin_file_history_cmd_open_file) },
{ "RecentFile1Action", NULL, "", NULL, NULL, G_CALLBACK (gnc_plugin_file_history_cmd_open_file) },
{ "RecentFile2Action", NULL, "", NULL, NULL, G_CALLBACK (gnc_plugin_file_history_cmd_open_file) },
{ "RecentFile3Action", NULL, "", NULL, NULL, G_CALLBACK (gnc_plugin_file_history_cmd_open_file) },
{ "RecentFile4Action", NULL, "", NULL, NULL, G_CALLBACK (gnc_plugin_file_history_cmd_open_file) },
{ "RecentFile5Action", NULL, "", NULL, NULL, G_CALLBACK (gnc_plugin_file_history_cmd_open_file) },
{ "RecentFile6Action", NULL, "", NULL, NULL, G_CALLBACK (gnc_plugin_file_history_cmd_open_file) },
{ "RecentFile7Action", NULL, "", NULL, NULL, G_CALLBACK (gnc_plugin_file_history_cmd_open_file) },
{ "RecentFile8Action", NULL, "", NULL, NULL, G_CALLBACK (gnc_plugin_file_history_cmd_open_file) },
{ "RecentFile9Action", NULL, "", NULL, NULL, G_CALLBACK (gnc_plugin_file_history_cmd_open_file) },
{ "RecentFile0Action", gnc_plugin_file_history_cmd_open_file, NULL, NULL, NULL },
{ "RecentFile1Action", gnc_plugin_file_history_cmd_open_file, NULL, NULL, NULL },
{ "RecentFile2Action", gnc_plugin_file_history_cmd_open_file, NULL, NULL, NULL },
{ "RecentFile3Action", gnc_plugin_file_history_cmd_open_file, NULL, NULL, NULL },
{ "RecentFile4Action", gnc_plugin_file_history_cmd_open_file, NULL, NULL, NULL },
{ "RecentFile5Action", gnc_plugin_file_history_cmd_open_file, NULL, NULL, NULL },
{ "RecentFile6Action", gnc_plugin_file_history_cmd_open_file, NULL, NULL, NULL },
{ "RecentFile7Action", gnc_plugin_file_history_cmd_open_file, NULL, NULL, NULL },
{ "RecentFile8Action", gnc_plugin_file_history_cmd_open_file, NULL, NULL, NULL },
{ "RecentFile9Action", gnc_plugin_file_history_cmd_open_file, NULL, NULL, NULL },
};
/** The number of actions provided by this plugin. */
static guint gnc_plugin_n_actions = G_N_ELEMENTS (gnc_plugin_actions);
static guint gnc_plugin_n_actions = G_N_ELEMENTS(gnc_plugin_actions);
/** The default menu items that need to be add to the menu */
static const gchar *gnc_plugin_load_ui_items [] =
{
"FilePlaceholder6",
NULL,
};
/** The instance private data for a file history plugin. This data
* structure is unused. */
@ -407,46 +414,65 @@ gnc_history_update_action (GncMainWindow *window,
gint index,
const gchar *filename)
{
GtkActionGroup *action_group;
GtkAction *action;
gchar *action_name, *label_name, *tooltip, *old_filename;
GncMenuModelSearch *gsm = g_new0 (GncMenuModelSearch, 1);
GtkWidget *menu_item = NULL;
gchar *action_name;
gint limit;
gboolean add_item = FALSE;
gint pos;
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);
action_name = g_strdup_printf("RecentFile%dAction", index);
action = gtk_action_group_get_action (action_group, action_name);
action_name = g_strdup_printf ("RecentFile%dAction", index);
gsm->search_action_label = NULL;
gsm->search_action_name = action_name;
if (!gnc_menubar_model_find_item (gnc_main_window_get_menu_model(window), gsm)) // could not find action_name
{
add_item = TRUE;
gsm->search_action_name = "FilePlaceholder6"; // placeholder
if (!gnc_menubar_model_find_item (gnc_main_window_get_menu_model(window), gsm))
{
LEAVE("Could not find 'menu_item' with action name '%s'", action_name);
g_free (gsm);
g_free (action_name);
return;
}
else
pos = gsm->index + index;
}
else
pos = gsm->index;
limit = gnc_prefs_get_int (GNC_PREFS_GROUP_HISTORY,
GNC_PREF_HISTORY_MAXFILES);
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);
GMenuItem *item;
gchar *label_name = gnc_history_generate_label (index, filename);
gchar *tooltip = gnc_history_generate_tooltip (index, filename);
gchar *full_action_name = g_strconcat (PLUGIN_ACTIONS_NAME, ".",
action_name, NULL);
/* 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));
item = g_menu_item_new (label_name, full_action_name);
g_menu_item_set_attribute (item, GNC_MENU_ATTRIBUTE_TOOLTIP, "s", tooltip);
if (!add_item)
g_menu_remove (G_MENU(gsm->model), pos);
g_menu_insert_item (G_MENU(gsm->model), pos, item);
g_free (full_action_name);
g_free (label_name);
g_free (tooltip);
}
else
{
gtk_action_set_visible(action, FALSE);
}
g_free(action_name);
g_free (gsm);
g_free (action_name);
LEAVE("");
}
@ -466,6 +492,7 @@ gnc_history_update_menus (GncMainWindow *window)
guint i;
ENTER("");
for (i = 0; i < MAX_HISTORY_FILES; i++)
{
pref = gnc_history_index_to_pref_name(i);
@ -518,7 +545,6 @@ gnc_plugin_history_list_changed (gpointer prefs,
gnc_history_update_action (window, index, filename);
g_free (filename);
gnc_main_window_actions_updated (window);
LEAVE("");
}
@ -538,18 +564,18 @@ gnc_plugin_file_history_class_init (GncPluginFileHistoryClass *klass)
object_class->finalize = gnc_plugin_file_history_finalize;
/* plugin info */
plugin_class->plugin_name = GNC_PLUGIN_FILE_HISTORY_NAME;
plugin_class->plugin_name = GNC_PLUGIN_FILE_HISTORY_NAME;
/* function overrides */
plugin_class->add_to_window = gnc_plugin_file_history_add_to_window;
plugin_class->remove_from_window =
gnc_plugin_file_history_remove_from_window;
plugin_class->remove_from_window = gnc_plugin_file_history_remove_from_window;
/* widget addition/removal */
plugin_class->actions_name = PLUGIN_ACTIONS_NAME;
plugin_class->actions = gnc_plugin_actions;
plugin_class->n_actions = gnc_plugin_n_actions;
plugin_class->ui_filename = PLUGIN_UI_FILENAME;
plugin_class->ui_updates = gnc_plugin_load_ui_items;
}
G_DEFINE_TYPE_WITH_PRIVATE(GncPluginFileHistory, gnc_plugin_file_history, GNC_TYPE_PLUGIN)
@ -633,8 +659,8 @@ gnc_plugin_file_history_add_to_window (GncPlugin *plugin,
*/
static void
gnc_plugin_file_history_remove_from_window (GncPlugin *plugin,
GncMainWindow *window,
GQuark type)
GncMainWindow *window,
GQuark type)
{
gnc_prefs_remove_cb_by_func (GNC_PREFS_GROUP_HISTORY, NULL,
gnc_plugin_history_list_changed, window);
@ -657,24 +683,37 @@ gnc_plugin_file_history_remove_from_window (GncPlugin *plugin,
* function and we're about to close all the windows anyway.
*/
static void
gnc_plugin_file_history_cmd_open_file (GtkAction *action,
GncMainWindowActionData *data)
gnc_plugin_file_history_cmd_open_file (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
gchar *filename;
GncMainWindowActionData *data = user_data;
gchar *filename, *pref, *index;
const gchar *action_name;
g_return_if_fail(GTK_IS_ACTION(action));
g_return_if_fail(data != NULL);
g_return_if_fail (G_IS_SIMPLE_ACTION(simple));
g_return_if_fail (data != NULL);
// action name will be of the form 'RecentFile1Action'
action_name = g_action_get_name (G_ACTION(simple));
index = g_utf8_substring (action_name, 10, 11);
pref = gnc_history_index_to_pref_name (atoi (index));
filename = gnc_prefs_get_string (GNC_PREFS_GROUP_HISTORY, pref);
PINFO("File to open is '%s' on action '%s'", filename, action_name);
/* DRH - Do we need to close all open windows but the first?
* Which progress bar should we be using? One in a window, or
* in a new "file loading" dialog???
*/
filename = g_object_get_data(G_OBJECT(action), FILENAME_STRING);
gnc_window_set_progressbar_window (GNC_WINDOW(data->window));
/* also opens new account page */
gnc_file_open_file (GTK_WINDOW (data->window),
filename, /*open_readonly*/ FALSE);
gnc_window_set_progressbar_window (NULL);
g_free (pref);
g_free (filename);
g_free (index);
}
/** @} */

View File

@ -26,7 +26,7 @@
/** @addtogroup MenuPlugins
@{ */
/** @addtogroup PluginMenuAdditions Non-GtkAction Menu Support
/** @addtogroup PluginMenuAdditions Non-GAction Menu Support
@{ */
/** @file gnc-plugin-menu-additions.c
@brief Functions providing menu items from scheme code.
@ -45,6 +45,7 @@
#include "gnc-window.h"
#include "gnc-ui.h"
#include "gnc-menu-extensions.h"
#include "gnc-gtk-utils.h"
static GObjectClass *parent_class = NULL;
@ -54,6 +55,7 @@ static void gnc_plugin_menu_additions_finalize (GObject *object);
static void gnc_plugin_menu_additions_add_to_window (GncPlugin *plugin, GncMainWindow *window, GQuark type);
static void gnc_plugin_menu_additions_remove_from_window (GncPlugin *plugin, GncMainWindow *window, GQuark type);
static void gnc_plugin_menu_additions_action_new_cb (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
/* Command callbacks */
@ -65,7 +67,7 @@ static QofLogModule log_module = GNC_MOD_GUI;
/** Private data for this plugin. This data structure is unused. */
typedef struct GncPluginMenuAdditionsPrivate
{
gpointer dummy;
GHashTable *item_hash;
} GncPluginMenuAdditionsPrivate;
#define GNC_PLUGIN_MENU_ADDITIONS_GET_PRIVATE(o) \
@ -80,11 +82,21 @@ typedef struct _GncPluginMenuAdditionsPerWindow
window. This plugin must maintain its own data because of the
way the menus are currently built. */
GncMainWindow *window;
GtkUIManager *ui_manager;
GtkActionGroup *group;
gint merge_id;
GHashTable *item_hash;
GHashTable *build_menu_hash;
GMenu *report_menu;
GMenu *sub_menu;
} GncPluginMenuAdditionsPerWindow;
/** An array of all of the actions provided by the account tree
* plugin. */
static GActionEntry gnc_plugin_actions [] =
{
{ "AdditionsAction", gnc_plugin_menu_additions_action_new_cb, "s", NULL, NULL },
};
/** The number of actions provided by this plugin. */
static guint gnc_plugin_n_actions = G_N_ELEMENTS(gnc_plugin_actions);
/************************************************************
* Object Implementation *
************************************************************/
@ -105,8 +117,11 @@ gnc_plugin_menu_additions_class_init (GncPluginMenuAdditionsClass *klass)
plugin_class->plugin_name = GNC_PLUGIN_MENU_ADDITIONS_NAME;
/* function overrides */
plugin_class->add_to_window = gnc_plugin_menu_additions_add_to_window;
plugin_class->add_to_window = gnc_plugin_menu_additions_add_to_window;
plugin_class->remove_from_window = gnc_plugin_menu_additions_remove_from_window;
plugin_class->actions_name = PLUGIN_ACTIONS_NAME;
plugin_class->actions = gnc_plugin_actions;
plugin_class->n_actions = gnc_plugin_n_actions;
}
static void
@ -119,9 +134,15 @@ gnc_plugin_menu_additions_init (GncPluginMenuAdditions *plugin)
static void
gnc_plugin_menu_additions_finalize (GObject *object)
{
g_return_if_fail (GNC_IS_PLUGIN_MENU_ADDITIONS (object));
GncPluginMenuAdditionsPrivate *priv;
g_return_if_fail (GNC_IS_PLUGIN_MENU_ADDITIONS(object));
ENTER("plugin %p", object);
priv = GNC_PLUGIN_MENU_ADDITIONS_GET_PRIVATE(object);
g_hash_table_destroy (priv->item_hash);
G_OBJECT_CLASS (parent_class)->finalize (object);
LEAVE("");
}
@ -161,27 +182,34 @@ gnc_main_window_to_scm (GncMainWindow *window)
return SWIG_NewPointerObj(window, main_window_type, 0);
}
/** The user has selected one of the items added by this plugin.
* Invoke the callback function that was registered along with the
* menu item.
*
* @param action A pointer to the action selected by the user. This
* action represents one of the items in the file history menu.
*
* @param data A pointer to the gnc-main-window data to be used by
* this function. This is mainly to find out which window it was
* that had a menu selected.
*/
static void
gnc_plugin_menu_additions_action_cb (GtkAction *action,
GncMainWindowActionData *data)
gnc_plugin_menu_additions_action_new_cb (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
GncMainWindowActionData *data = user_data;
GncPluginMenuAdditionsPrivate *priv;
GncMainWindowActionData *cb_data;
gsize length;
const gchar *action_name;
g_return_if_fail(GTK_IS_ACTION(action));
g_return_if_fail(data != NULL);
g_return_if_fail (G_IS_SIMPLE_ACTION(simple));
gnc_extension_invoke_cb(data->data, gnc_main_window_to_scm(data->window));
ENTER("");
priv = GNC_PLUGIN_MENU_ADDITIONS_GET_PRIVATE(data->data);
action_name = g_variant_get_string (parameter, &length);
PINFO("action name is '%s'", action_name);
cb_data = g_hash_table_lookup (priv->item_hash, action_name);
if (cb_data)
{
PINFO("Found action in table");
gnc_extension_invoke_cb (cb_data->data, gnc_main_window_to_scm (cb_data->window));
}
LEAVE("");
}
@ -201,9 +229,9 @@ gnc_menu_additions_sort (ExtensionInfo *a, ExtensionInfo *b)
{
if (a->type == b->type)
return strcmp(a->sort_key, b->sort_key);
else if (a->type == GTK_UI_MANAGER_MENU)
else if (a->type == GNC_SUB_MENU_ITEM)
return -1;
else if (b->type == GTK_UI_MANAGER_MENU)
else if (b->type == GNC_SUB_MENU_ITEM)
return 1;
else
return 0;
@ -238,23 +266,23 @@ gnc_menu_additions_do_preassigned_accel (ExtensionInfo *info, GHashTable *table)
gchar *map, *new_map, *accel_key;
const gchar *ptr;
ENTER("Checking %s/%s [%s]", info->path, info->ae.label, info->ae.name);
ENTER("Checking %s/%s [%s]", info->path, info->action_label, info->action_name);
if (info->accel_assigned)
{
LEAVE("Already processed");
return;
}
if (!g_utf8_validate(info->ae.label, -1, NULL))
if (!g_utf8_validate(info->action_label, -1, NULL))
{
g_warning("Extension menu label '%s' is not valid utf8.", info->ae.label);
g_warning ("Extension menu label '%s' is not valid utf8.", info->action_label);
info->accel_assigned = TRUE;
LEAVE("Label is invalid utf8");
return;
}
/* Was an accelerator pre-assigned in the source? */
ptr = g_utf8_strchr(info->ae.label, -1, '_');
ptr = g_utf8_strchr (info->action_label, -1, '_');
if (ptr == NULL)
{
LEAVE("not preassigned");
@ -298,7 +326,7 @@ gnc_menu_additions_assign_accel (ExtensionInfo *info, GHashTable *table)
gint len;
gboolean map_allocated = FALSE;
ENTER("Checking %s/%s [%s]", info->path, info->ae.label, info->ae.name);
ENTER("Checking %s/%s [%s]", info->path, info->action_label, info->action_name);
if (info->accel_assigned)
{
LEAVE("Already processed");
@ -314,7 +342,7 @@ gnc_menu_additions_assign_accel (ExtensionInfo *info, GHashTable *table)
}
DEBUG("map '%s', path %s", map, info->path);
for (ptr = info->ae.label; *ptr; ptr = g_utf8_next_char(ptr))
for (ptr = info->action_label; *ptr; ptr = g_utf8_next_char(ptr))
{
uni = g_utf8_get_char(ptr);
if (!g_unichar_isalpha(uni))
@ -340,13 +368,13 @@ gnc_menu_additions_assign_accel (ExtensionInfo *info, GHashTable *table)
}
/* Now build a new string in the form "<start>_<end>". */
start = g_strndup(info->ae.label, ptr - info->ae.label);
start = g_strndup (info->action_label, ptr - info->action_label);
DEBUG("start %p, len %ld, text '%s'", start, g_utf8_strlen(start, -1), start);
new_label = g_strconcat(start, "_", ptr, (gchar *)NULL);
g_free(start);
DEBUG("label '%s' -> '%s'", info->ae.label, new_label);
g_free((gchar *)info->ae.label);
info->ae.label = new_label;
DEBUG("label '%s' -> '%s'", info->action_label, new_label);
g_free((gchar *)info->action_label);
info->action_label = new_label;
/* Now build a new map. Old one freed automatically. */
new_map = g_strconcat(map, buf, (gchar *)NULL);
@ -361,6 +389,29 @@ gnc_menu_additions_assign_accel (ExtensionInfo *info, GHashTable *table)
LEAVE("assigned");
}
static GMenuItem *
setup_tooltip_for_gmenu_item (ExtensionInfo *ext_info)
{
GMenuItem *gmenu_item = NULL;
if (g_strcmp0 (ext_info->typeStr, "menuitem") == 0)
{
gmenu_item = g_menu_item_new (ext_info->action_label, NULL);
g_menu_item_set_action_and_target_value (gmenu_item, "gnc-plugin-menu-additions-actions.AdditionsAction",
g_variant_new_string (ext_info->action_name));
g_menu_item_set_attribute (gmenu_item, GNC_MENU_ATTRIBUTE_TOOLTIP, "s", ext_info->action_tooltip);
}
if (g_strcmp0 (ext_info->typeStr, "menu") == 0)
{
GMenuModel *sub_menu = G_MENU_MODEL(g_menu_new ());
gmenu_item = g_menu_item_new_submenu (ext_info->action_label, sub_menu);
g_object_set_data (G_OBJECT(gmenu_item), "sub-menu", sub_menu);
}
return gmenu_item;
}
/** Add one extension item to the UI manager. This function creates a
* per-callback data structure for easy access to the opaque Scheme
@ -376,23 +427,45 @@ gnc_menu_additions_menu_setup_one (ExtensionInfo *ext_info,
GncPluginMenuAdditionsPerWindow *per_window)
{
GncMainWindowActionData *cb_data;
GMenuItem *item_path, *item_with_full_path;
gchar *full_path = NULL;
GMenuItem *gmenu_item = NULL;
DEBUG( "Adding %s/%s [%s] as [%s]", ext_info->path, ext_info->ae.label,
ext_info->ae.name, ext_info->typeStr );
DEBUG("Adding %s/%s [%s] as [%s]", ext_info->path, ext_info->action_label,
ext_info->action_name, ext_info->typeStr );
cb_data = g_new0 (GncMainWindowActionData, 1);
cb_data->window = per_window->window;
cb_data->data = ext_info->extension;
if (ext_info->type == GTK_UI_MANAGER_MENUITEM)
ext_info->ae.callback = (GCallback)gnc_plugin_menu_additions_action_cb;
g_hash_table_insert (per_window->item_hash, g_strdup (ext_info->action_name), cb_data);
gtk_action_group_add_actions_full(per_window->group, &ext_info->ae, 1,
cb_data, g_free);
gtk_ui_manager_add_ui(per_window->ui_manager, per_window->merge_id,
ext_info->path, ext_info->ae.label, ext_info->ae.name,
ext_info->type, FALSE);
gtk_ui_manager_ensure_update(per_window->ui_manager);
if (g_str_has_suffix (ext_info->path, "_Custom"))
return;
full_path = g_strconcat (ext_info->path, "/", ext_info->action_label, NULL);
item_path = g_hash_table_lookup (per_window->build_menu_hash, ext_info->path);
item_with_full_path = g_hash_table_lookup (per_window->build_menu_hash, full_path);
if (!item_path && !item_with_full_path)
{
gmenu_item = setup_tooltip_for_gmenu_item (ext_info);
g_menu_append_item (G_MENU(per_window->report_menu), gmenu_item);
}
if (item_path && !item_with_full_path)
{
GMenuModel *sub_menu = G_MENU_MODEL(g_object_get_data (G_OBJECT(item_path), "sub-menu"));
gmenu_item = setup_tooltip_for_gmenu_item (ext_info);
g_menu_append_item (G_MENU(sub_menu), gmenu_item);
}
g_hash_table_insert (per_window->build_menu_hash, g_strdup (full_path), gmenu_item);
g_free (full_path);
}
@ -410,42 +483,57 @@ 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)
{
GncPluginMenuAdditionsPrivate *priv = GNC_PLUGIN_MENU_ADDITIONS_GET_PRIVATE(plugin);
GncPluginMenuAdditionsPerWindow per_window;
static GOnce accel_table_init = G_ONCE_INIT;
static GHashTable *table;
GSList *menu_list;
GMenuModel *menubar_model = gnc_main_window_get_menu_model (window);
GncMenuModelSearch *gsm = g_new0 (GncMenuModelSearch, 1);
ENTER(" ");
per_window.window = window;
per_window.ui_manager = window->ui_merge;
per_window.group = gtk_action_group_new ("MenuAdditions" );
gtk_action_group_set_translation_domain (per_window.group, PROJECT_NAME);
per_window.merge_id = gtk_ui_manager_new_merge_id(window->ui_merge);
gtk_ui_manager_insert_action_group(window->ui_merge, per_window.group, 0);
per_window.item_hash = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free);
menu_list = g_slist_sort(gnc_extensions_get_menu_list(),
(GCompareFunc)gnc_menu_additions_sort);
per_window.build_menu_hash = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
per_window.report_menu = g_menu_new ();
menu_list = g_slist_sort (gnc_extensions_get_menu_list(),
(GCompareFunc)gnc_menu_additions_sort);
/* Assign accelerators */
table = g_once(&accel_table_init, gnc_menu_additions_init_accel_table, NULL);
g_slist_foreach(menu_list,
table = g_once (&accel_table_init, gnc_menu_additions_init_accel_table, NULL);
g_slist_foreach (menu_list,
(GFunc)gnc_menu_additions_do_preassigned_accel, table);
g_slist_foreach(menu_list, (GFunc)gnc_menu_additions_assign_accel, table);
g_slist_foreach (menu_list, (GFunc)gnc_menu_additions_assign_accel, table);
/* Add to window. */
g_slist_foreach(menu_list, (GFunc)gnc_menu_additions_menu_setup_one,
&per_window);
g_slist_foreach (menu_list, (GFunc)gnc_menu_additions_menu_setup_one,
&per_window);
/* Tell the window code about the actions that were just added
* behind its back (so to speak) */
gnc_main_window_manual_merge_actions (window, PLUGIN_ACTIONS_NAME,
per_window.group, per_window.merge_id);
priv->item_hash = per_window.item_hash;
// add the report menu to the window
gsm->search_action_label = NULL;
gsm->search_action_name = "ReportsPlaceholder0";
if (gnc_menubar_model_find_item (menubar_model, gsm))
{
g_menu_insert_section (G_MENU(gsm->model), gsm->index, NULL, G_MENU_MODEL(per_window.report_menu));
}
else
PERR("Could not find 'ReportsAction' in menu model");
g_hash_table_destroy (per_window.build_menu_hash);
g_slist_free (menu_list);
g_free (gsm);
g_slist_free(menu_list);
LEAVE(" ");
}
@ -463,23 +551,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);
/* Note: This code does not clean up the per-callback data structures
* that are created by the gnc_menu_additions_menu_setup_one()
* function. Its not much memory and shouldn't be a problem. */
if (simple_action_group && !window->just_plugin_prefs)
gtk_widget_insert_action_group (GTK_WIDGET(window), PLUGIN_ACTIONS_NAME, NULL);
LEAVE(" ");
}

View File

@ -22,7 +22,7 @@
/** @addtogroup MenuPlugins
@{ */
/** @addtogroup PluginMenuAdditions Non-GtkAction Menu Support
/** @addtogroup PluginMenuAdditions Non-GAction Menu Support
@{ */
/** @file gnc-plugin-menu-additions.h
@brief Functions providing menu items from scheme code.

View File

@ -75,13 +75,10 @@ enum
PROP_0,
PROP_PAGE_NAME,
PROP_PAGE_COLOR,
PROP_PAGE_URI,
PROP_BOOK,
PROP_STATUSBAR_TEXT,
PROP_USE_NEW_WINDOW,
PROP_UI_DESCRIPTION,
PROP_UI_MERGE,
PROP_ACTION_GROUP,
};
static guint signals[LAST_SIGNAL] = { 0 };
@ -91,11 +88,13 @@ static guint signals[LAST_SIGNAL] = { 0 };
typedef struct _GncPluginPagePrivate
{
/** The group of all actions provided by this plugin. */
GtkActionGroup *action_group;
GtkUIManager *ui_merge;
guint merge_id;
char *ui_description;
GtkBuilder *builder; //FIXMEb added
GSimpleActionGroup *simple_action_group; //FIXMEb added
const gchar *simple_action_group_name; //FIXMEb added
const gchar *menu_qualifier; //FIXMEb added
GList *books;
gboolean use_new_window;
@ -252,47 +251,36 @@ gnc_plugin_page_recreate_page(GtkWidget *window,
}
/* Add the actions for a content page to the specified window. */
void
gnc_plugin_page_merge_actions (GncPluginPage *page,
GtkUIManager *ui_merge)
gnc_plugin_page_merge_actions (GncPluginPage *page)
{
GncPluginPagePrivate *priv;
GError *error = NULL;
gchar *resource;
g_return_if_fail (GNC_IS_PLUGIN_PAGE(page));
priv = GNC_PLUGIN_PAGE_GET_PRIVATE(page);
priv->ui_merge = ui_merge;
gtk_action_group_set_sensitive (priv->action_group, TRUE);
priv->merge_id = gnc_plugin_add_actions (priv->ui_merge,
priv->action_group,
priv->ui_description);
if (!priv->builder)
priv->builder = gtk_builder_new ();
resource = g_strconcat ("/org/gnucash/ui/", priv->ui_description, NULL);
gtk_builder_set_translation_domain (priv->builder, PROJECT_NAME);
gtk_builder_add_from_resource (priv->builder, resource, &error);
if (error)
{
g_critical ("Failed to load ui resource %s, Error %s", resource, error->message);
g_error_free (error);
}
g_free (resource);
}
/* Remove the actions for a content page from the specified window. */
void
gnc_plugin_page_unmerge_actions (GncPluginPage *page,
GtkUIManager *ui_merge)
{
GncPluginPagePrivate *priv;
priv = GNC_PLUGIN_PAGE_GET_PRIVATE(page);
g_return_if_fail (GNC_IS_PLUGIN_PAGE(page));
g_return_if_fail (priv->merge_id != 0);
g_return_if_fail (priv->action_group != NULL);
gtk_ui_manager_remove_ui (ui_merge, priv->merge_id);
gtk_action_group_set_sensitive (priv->action_group, FALSE);
gtk_ui_manager_remove_action_group (ui_merge, priv->action_group);
priv->ui_merge = NULL;
priv->merge_id = 0;
}
GtkAction *
GAction *
gnc_plugin_page_get_action (GncPluginPage *page, const gchar *name)
{
GncPluginPagePrivate *priv;
@ -301,9 +289,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);
}
@ -399,15 +387,6 @@ gnc_plugin_page_class_init (GncPluginPageClass *klass)
NULL,
G_PARAM_READWRITE));
g_object_class_install_property
(gobject_class,
PROP_PAGE_URI,
g_param_spec_string ("page-uri",
"Page URI",
"The uri for this page.",
NULL,
G_PARAM_READWRITE));
g_object_class_install_property
(gobject_class,
PROP_STATUSBAR_TEXT,
@ -439,28 +418,6 @@ gnc_plugin_page_class_init (GncPluginPageClass *klass)
NULL,
G_PARAM_READWRITE));
g_object_class_install_property
(gobject_class,
PROP_UI_MERGE,
g_param_spec_object ("ui-merge",
"UI Merge",
"A pointer to the GtkUIManager object that "
"represents this pages menu hierarchy.",
GTK_TYPE_UI_MANAGER,
G_PARAM_READABLE));
g_object_class_install_property
(gobject_class,
PROP_ACTION_GROUP,
g_param_spec_object ("action-group",
"Action Group",
"A pointer to the GtkActionGroup object that "
"represents this pages available menu/toolbar "
"actions.",
GTK_TYPE_ACTION_GROUP,
G_PARAM_READABLE));
signals[INSERTED] = g_signal_new ("inserted",
@ -516,9 +473,9 @@ gnc_plugin_page_init (GncPluginPage *page, void *data)
priv = GNC_PLUGIN_PAGE_GET_PRIVATE(page);
priv->page_name = NULL;
priv->page_color = NULL;
priv->uri = NULL;
priv->page_changed_id = 0;
priv->focus_source_id = 0;
priv->menu_qualifier = NULL;
page->window = NULL;
page->summarybar = NULL;
@ -557,9 +514,6 @@ gnc_plugin_page_finalize (GObject *object)
if (priv->page_color)
g_free (priv->page_color);
if (priv->uri)
g_free (priv->uri);
if (priv->statusbar_text)
g_free (priv->statusbar_text);
@ -623,9 +577,6 @@ gnc_plugin_page_get_property (GObject *object,
case PROP_PAGE_COLOR:
g_value_set_string (value, priv->page_color);
break;
case PROP_PAGE_URI:
g_value_set_string (value, priv->uri);
break;
case PROP_STATUSBAR_TEXT:
g_value_set_string (value, priv->statusbar_text);
break;
@ -635,12 +586,6 @@ gnc_plugin_page_get_property (GObject *object,
case PROP_UI_DESCRIPTION:
g_value_set_string (value, priv->ui_description);
break;
case PROP_UI_MERGE:
g_value_take_object (value, priv->ui_merge);
break;
case PROP_ACTION_GROUP:
g_value_take_object (value, priv->action_group);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@ -684,9 +629,6 @@ gnc_plugin_page_set_property (GObject *object,
case PROP_PAGE_COLOR:
gnc_plugin_page_set_page_color (page, g_value_get_string (value));
break;
case PROP_PAGE_URI:
gnc_plugin_page_set_uri (page, g_value_get_string (value));
break;
case PROP_STATUSBAR_TEXT:
gnc_plugin_page_set_statusbar_text (page, g_value_get_string (value));
break;
@ -971,35 +913,6 @@ gnc_plugin_page_disconnect_page_changed (GncPluginPage *page)
}
/* Retrieve the Uniform Resource Identifier for this page. */
const gchar *
gnc_plugin_page_get_uri (GncPluginPage *page)
{
GncPluginPagePrivate *priv;
g_return_val_if_fail (GNC_IS_PLUGIN_PAGE(page), NULL);
priv = GNC_PLUGIN_PAGE_GET_PRIVATE(page);
return priv->uri;
}
/* Set the Uniform Resource Identifier for this page. */
void
gnc_plugin_page_set_uri (GncPluginPage *page, const gchar *name)
{
GncPluginPagePrivate *priv;
g_return_if_fail (GNC_IS_PLUGIN_PAGE(page));
priv = GNC_PLUGIN_PAGE_GET_PRIVATE(page);
if (priv->uri)
g_free (priv->uri);
priv->uri = g_strdup (name);
}
/* Retrieve the statusbar text associated with this page. */
const gchar *
gnc_plugin_page_get_statusbar_text (GncPluginPage *page)
@ -1089,44 +1002,77 @@ 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;
}
/* Retrieve the GtkActionGroup object associated with this page. */
GtkActionGroup *
gnc_plugin_page_get_action_group(GncPluginPage *page)
/* Retrieve the menu qualifier associated with this page. */
const gchar *
gnc_plugin_page_get_menu_qualifier (GncPluginPage *page)
{
GncPluginPagePrivate *priv;
g_return_val_if_fail (GNC_IS_PLUGIN_PAGE(page), NULL);
priv = GNC_PLUGIN_PAGE_GET_PRIVATE(page);
return priv->action_group;
return priv->menu_qualifier;
}
/* Create the GtkActionGroup object associated with this page. */
GtkActionGroup *
void
gnc_plugin_page_set_menu_qualifier (GncPluginPage *page,
const char *menu_qualifier)
{
GncPluginPagePrivate *priv;
g_return_if_fail (GNC_IS_PLUGIN_PAGE(page));
priv = GNC_PLUGIN_PAGE_GET_PRIVATE(page);
priv->menu_qualifier = menu_qualifier;
}
GSimpleActionGroup *
gnc_plugin_page_get_action_group (GncPluginPage *page)
{
GncPluginPagePrivate *priv;
g_return_val_if_fail (GNC_IS_PLUGIN_PAGE(page), NULL);
priv = GNC_PLUGIN_PAGE_GET_PRIVATE(page);
return priv->simple_action_group;
}
GSimpleActionGroup *
gnc_plugin_page_create_action_group (GncPluginPage *page, const gchar *group_name)
{
GncPluginPagePrivate *priv = GNC_PLUGIN_PAGE_GET_PRIVATE(page);
priv->simple_action_group = g_simple_action_group_new ();
priv->simple_action_group_name = group_name;
return priv->simple_action_group;
}
const gchar *
gnc_plugin_page_get_simple_action_group_name (GncPluginPage *page)
{
GncPluginPagePrivate *priv;
GtkActionGroup *group;
g_return_val_if_fail (GNC_IS_PLUGIN_PAGE(page), NULL);
priv = GNC_PLUGIN_PAGE_GET_PRIVATE(page);
group = gtk_action_group_new (group_name);
gtk_action_group_set_translation_domain (group, PROJECT_NAME);
priv->action_group = group;
return group;
return priv->simple_action_group_name;
}
gboolean

View File

@ -284,24 +284,8 @@ GncPluginPage *gnc_plugin_page_recreate_page (GtkWidget *window,
*
* @param plugin_page A pointer to the page whose actions should be
* added to the user interface.
*
* @param merge A pointer to the UI manager data structure for a
* window.
*/
void gnc_plugin_page_merge_actions (GncPluginPage *plugin_page,
GtkUIManager *merge);
/** Remove the actions for a content page from the specified window.
*
* @param plugin_page A pointer to the page whose actions should be
* removed from the user interface.
*
* @param merge A pointer to the UI manager data structure for a
* window.
*/
void gnc_plugin_page_unmerge_actions (GncPluginPage *plugin_page,
GtkUIManager *merge);
void gnc_plugin_page_merge_actions (GncPluginPage *plugin_page); //FIXMEb added
/** Retrieve the textual name of a plugin.
@ -440,25 +424,6 @@ void gnc_plugin_page_inserted_cb (GncPluginPage *page, gpointer user_data);
void gnc_plugin_page_disconnect_page_changed (GncPluginPage *page);
/** Retrieve the Uniform Resource Identifier for this page.
*
* @param page The page whose URI should be retrieved.
*
* @return The URI for this page. This string is owned by the page and
* should not be freed by the caller.
*/
const gchar *gnc_plugin_page_get_uri (GncPluginPage *page);
/** Set the Uniform Resource Identifier for this page.
*
* @param page The page whose URI should be set.
*
* @param name The new URI for the page.
*/
void gnc_plugin_page_set_uri (GncPluginPage *page, const char *name);
/** Retrieve the statusbar text associated with this page.
*
* @param page The page whose statusbar should text be retrieved.
@ -522,28 +487,45 @@ const char *gnc_plugin_page_get_ui_description (GncPluginPage *page);
* @param ui_filename The filename (no path) of the alternate UI.
*/
void gnc_plugin_page_set_ui_description (GncPluginPage *page,
const char *ui_filename);
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); //FIXMEb added
/** Retrieve the GtkActionGroup object associated with this page.
/** Retrieve the menu qualifier for this page.
*
* @param page The page whose quailifier string should be retrieved.
*
* @return A qualifier string for this page.
*/
const gchar * gnc_plugin_page_get_menu_qualifier (GncPluginPage *page); //FIXMEb added
/** Set a qualifier string for this page. This string is used when there
* is more than one menu associated with the page.
*
* @param page The page whose qualifier string should be updated.
*
* @param menu_qualifier A string to be used as for the qualifier.
*/
void gnc_plugin_page_set_menu_qualifier (GncPluginPage *page,
const char *menu_qualifier); //FIXMEb added
/** Retrieve the GSimpleActionGroup object associated with this page.
*
* @param page The page whose menu/toolbar action group should be
* retrieved.
*
* @return A pointer to the GtkActionGroup object for this page.
* @return A pointer to the GSimpleActionGroup object for this page.
*/
GtkActionGroup *gnc_plugin_page_get_action_group (GncPluginPage *page);
GSimpleActionGroup *gnc_plugin_page_get_action_group (GncPluginPage *page); //FIXMEb added
/** Create the GtkActionGroup object associated with this page.
/** Create the GSimpleActionGroup object associated with this page.
*
* @param page The page whose menu/toolbar action group should be
* created.
@ -552,22 +534,33 @@ GtkActionGroup *gnc_plugin_page_get_action_group (GncPluginPage *page);
* name is used to associate key bindings with actions, so it should
* be consistent across all pages of the same type.
*
* @return A pointer to the newly created GtkActionGroup object for
* @return A pointer to the newly created GSimpleActionGroup object for
* this page.
*/
GtkActionGroup * gnc_plugin_page_create_action_group (GncPluginPage *page,
const gchar *group_name);
GSimpleActionGroup * gnc_plugin_page_create_action_group (GncPluginPage *page,
const gchar *group_name); //FIXMEb added
/** Retrieve a GtkAction object associated with this page.
/** Retrieve the simple action group name associated with this plugin
* page.
*
* @param page The page whose simple action group should be retrieved.
*
* @return The simple action group name associated with this plugin.
*/
const gchar *gnc_plugin_page_get_simple_action_group_name (GncPluginPage *page); //FIXMEb added
/** Retrieve a GAction object associated with this page.
*
* @param page The page whose menu/toolbar action group should be
* retrieved.
*
* @param name The name of the GtkAction to find.
* @param action_name The name of the GAction to find.
*
* @return A pointer to the retuested GtkAction object or NULL.
* @return A pointer to the requested GAction object or NULL.
*/
GtkAction *gnc_plugin_page_get_action (GncPluginPage *page, const gchar *name);
GAction *gnc_plugin_page_get_action (GncPluginPage *page,
const gchar *action_name);
/* Signals */
void gnc_plugin_page_inserted (GncPluginPage *plugin_page);

View File

@ -42,6 +42,7 @@
#include "gnc-filepath-utils.h"
#include "gnc-gnome-utils.h"
#include "gnc-gobject-utils.h"
#include "gnc-gtk-utils.h"
/** The debugging module that this .o belongs to. */
static QofLogModule log_module = GNC_MOD_GUI;
@ -130,7 +131,6 @@ gnc_plugin_add_to_window (GncPlugin *plugin,
GQuark type)
{
GncPluginClass *klass;
GtkActionGroup *action_group;
g_return_if_fail (GNC_IS_PLUGIN (plugin));
klass = GNC_PLUGIN_GET_CLASS (plugin);
@ -143,20 +143,11 @@ 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->ui_updates,
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);
}
}
/*
@ -204,7 +195,7 @@ gnc_plugin_remove_from_window (GncPlugin *plugin,
if (klass->actions_name && !window->just_plugin_prefs)
{
DEBUG ("%s: %d actions to unmerge",
klass->actions_name, (klass->n_actions + klass->n_toggle_actions));
klass->actions_name, (klass->n_actions));
gnc_main_window_unmerge_actions (window, klass->actions_name);
}
LEAVE ("");
@ -231,155 +222,84 @@ 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,
action_toolbar_labels *toolbar_labels)
gnc_plugin_init_short_names (GtkWidget *toolbar,
GncToolBarShortNames *toolbar_labels)
{
GtkAction *action;
gint i;
g_return_if_fail (toolbar != NULL);
g_return_if_fail (toolbar_labels != NULL);
for (i = 0; toolbar_labels[i].action_name; i++)
for (gint 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));
GtkWidget *tool_item = gnc_find_toolbar_item (toolbar, toolbar_labels[i].action_name);
if (!tool_item)
continue;
gtk_tool_button_set_label (GTK_TOOL_BUTTON(tool_item), _(toolbar_labels[i].short_label));
gtk_tool_button_set_use_underline (GTK_TOOL_BUTTON(tool_item), TRUE);
}
}
/** Mark certain actions as "important". This means that their labels
* will appear when the toolbar is set to "Icons and important text"
* (e.g. GTK_TOOLBAR_BOTH_HORIZ) mode.
*
* See gnc-plugin.h for documentation on the function arguments. */
/* Update the sensitivity of an action */
void
gnc_plugin_set_important_actions (GtkActionGroup *action_group,
const gchar **name)
gnc_plugin_set_actions_enabled (GActionMap *action_map,
const gchar **action_names, gboolean enable)
{
GtkAction *action;
gint i;
g_return_if_fail (action_map != NULL);
for (i = 0; name[i]; i++)
for (gint i = 0; action_names[i]; i++)
{
action = gtk_action_group_get_action (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
* can't *all* be that important, can they? */
g_assert(i <= 3);
}
/* Update a property of existing UI actions. This function can
* modify actions making them visible, invisible, sensitive, or
* insensitive.
*
* See gnc-plugin.h for documentation on the function arguments. */
void
gnc_plugin_update_actions (GtkActionGroup *action_group,
const gchar **action_names,
const gchar *property_name,
gboolean value)
{
GtkAction *action;
gint i;
for (i = 0; action_names[i]; i++)
{
action = gtk_action_group_get_action (action_group, action_names[i]);
GAction *action = g_action_map_lookup_action (G_ACTION_MAP(action_map),
action_names[i]);
if (action)
{
g_object_set (G_OBJECT(action), property_name, value, NULL);
}
g_simple_action_set_enabled (G_SIMPLE_ACTION(action), enable);
else
{
g_warning("No such action with name '%s' in action group %s (size %d)",
action_names[i], gtk_action_group_get_name(action_group),
g_list_length(gtk_action_group_list_actions(action_group)));
}
PERR("No such action with name '%s' in action group %p)",
action_names[i], action_map);
}
}
/** Load a new set of actions into an existing UI.
*
* See gnc-plugin.h for documentation on the function arguments. */
gint
gnc_plugin_add_actions (GtkUIManager *ui_merge,
GtkActionGroup *action_group,
const gchar *filename)
void
gnc_plugin_add_menu_tooltip_callbacks (GtkWidget *menubar,
GMenuModel *menubar_model,
GtkWidget *statusbar)
{
GError *error = NULL;
gchar *pathname;
gint merge_id;
GList *menu_item_list;
g_return_val_if_fail (ui_merge, 0);
g_return_val_if_fail (action_group, 0);
g_return_val_if_fail (filename, 0);
g_return_if_fail (GTK_IS_MENU_BAR(menubar));
g_return_if_fail (G_IS_MENU_MODEL(menubar_model));
g_return_if_fail (GTK_IS_STATUSBAR(statusbar));
ENTER("ui_merge %p, action_group %p, filename %s",
ui_merge, action_group, filename);
gtk_ui_manager_insert_action_group (ui_merge, action_group, 0);
menu_item_list = gnc_menu_get_items (menubar);
pathname = gnc_filepath_locate_ui_file (filename);
if (pathname == NULL)
for (GList *node = menu_item_list; node; node = node->next)
{
LEAVE("fail");
return 0;
}
GtkWidget *menu_item = node->data;
merge_id = gtk_ui_manager_add_ui_from_file (ui_merge, pathname, &error);
DEBUG("merge_id is %d", merge_id);
g_assert(merge_id || error);
if (merge_id)
{
gtk_ui_manager_ensure_update (ui_merge);
gnc_menu_item_setup_tooltip_to_statusbar_callback (menu_item, statusbar);
}
else
{
g_critical("Failed to load ui file.\n Filename %s\n Error %s",
filename, error->message);
g_error_free(error);
}
g_free(pathname);
LEAVE(" ");
return merge_id;
g_object_set_data (G_OBJECT(statusbar), "menu-model", menubar_model);
g_list_free (menu_item_list);
}
#if 0
static void
gnc_plugin_base_init (gpointer klass)
for_each_tool_action (GtkWidget *widget, gpointer user_data)
{
static gboolean initialized = FALSE;
GtkWidget *statusbar = user_data;
if (!initialized)
{
initialized = TRUE;
signals[MERGE_ACTIONS] = g_signal_new ("merge-actions",
G_OBJECT_CLASS_TYPE (klass),
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (GncPluginClass, merge_actions),
NULL, NULL,
g_cclosure_marshal_VOID__POINTER,
G_TYPE_NONE,
1,
GTK_TYPE_MENU_MERGE);
signals[UNMERGE_ACTIONS] = g_signal_new ("unmerge-actions",
G_OBJECT_CLASS_TYPE (klass),
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (GncPluginClass, unmerge_actions),
NULL, NULL,
g_cclosure_marshal_VOID__POINTER,
G_TYPE_NONE,
1,
GTK_TYPE_MENU_MERGE);
}
if (GTK_IS_ACTIONABLE(widget))
gnc_tool_item_setup_tooltip_to_statusbar_callback (widget, statusbar);
}
void
gnc_plugin_add_toolbar_tooltip_callbacks (GtkWidget *toolbar, GtkWidget *statusbar)
{
g_return_if_fail (GTK_IS_TOOLBAR(toolbar));
g_return_if_fail (GTK_IS_STATUSBAR(statusbar));
gtk_container_foreach (GTK_CONTAINER(toolbar), for_each_tool_action, statusbar);
}
#endif
/** @} */
/** @} */

View File

@ -119,19 +119,13 @@ typedef struct
const gchar *actions_name;
/** An array of actions that should automatically be added to
* any GnuCash "main" content window that is opened. */
GtkActionEntry *actions;
GActionEntry *actions; //FIXMEb added
/** The number of actions in the actions array. */
guint n_actions;
/** An array of toggle actions that should automatically be added to
* any GnuCash "main" content window that is opened. */
GtkToggleActionEntry *toggle_actions;
/** The number of toggle actions in the toggle actions array. */
guint n_toggle_actions;
/** A NULL terminated list of actions that should be considered
* important. In the toolbar, these actions will display the
* action name when the toolbar is in "text beside icons"
* mode. */
const gchar **important_actions;
guint n_actions; //FIXMEb added
/** An array of ui updates for the menu model */
const gchar **ui_updates; //FIXMEb added
/** The relative name of the XML file describing the
* menu/toolbar action items. */
const gchar *ui_filename;
@ -231,6 +225,8 @@ typedef struct
const char *action_name;
/** The alternate toolbar label to use */
const char *label;
/** The tooltip for the label */
const char *tooltip;
} action_toolbar_labels;
@ -247,69 +243,50 @@ typedef struct
* group.
*
* @param toolbar_labels A pointer to a NULL terminated array of data
* action_toolbar_labels items.
* GncToolBarShortNames items.
*/
void gnc_plugin_init_short_names (GtkActionGroup *action_group,
action_toolbar_labels *toolbar_labels);
void gnc_plugin_init_short_names (GtkWidget *toolbar,
GncToolBarShortNames *toolbar_labels);
/** Mark certain actions as "important". This means that their labels
* will appear when the toolbar is set to "Icons and important text"
* (e.g. GTK_TOOLBAR_BOTH_HORIZ) mode.
*
* @param action_group The group of all actions associated with a
* plugin or plugin page. All actions to me modified must be in this
/** This function sets the sensitivity of a GAction in a specific
* 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,
const gchar **names);
/** Update a property on a set of existing GtkActions. This function
* can be easily used to make a list of actions visible, invisible,
* sensitive, or insensitive.
*
* @param action_group The group of all actions associated with a
* plugin or plugin page. All actions to be modified must be
* contained in this group.
* @param action_map The action map associated with the window.
*
* @param action_names A NULL terminated list of actions names that
* should be modified.
*
* @param property_name The property name to be changed on the
* specified actions. The only two GtkAction properties that it makes
* sense to modify are "visible" and "sensitive".
*
* @param value A boolean specifying the new state for the specified
* @param enable A boolean specifying the new state for the specified
* property.
*/
void gnc_plugin_update_actions (GtkActionGroup *action_group,
const gchar **action_names,
const gchar *property_name,
gboolean value);
void gnc_plugin_set_actions_enabled (GActionMap *action_map,
const gchar **action_names,
gboolean enable); //FIXMEb added
/** Load a new set of actions into an existing UI. The actions from
* the provided group will be merged into the pre-existing ui, as
* directed by the specified file.
/** This function adds the tooltip callbacks to make the tooltips
* appear in the status bar.
*
* @param ui_merge A pointer to the UI manager data structure for a
* window.
* @param menubar The main window menu bar widget.
*
* @param action_group The set of actions provided by a given plugin.
* @param menubar_model The GMenuModel used to create the menubar.
*
* @param filename The name of the ui description file. This file
* name will be searched for in the ui directory.
*
* @return The merge_id number for the newly merged UI. If an error
* occurred, the return value is 0.
* @param statusbar The status bar widget in the main window.
*/
gint gnc_plugin_add_actions (GtkUIManager *ui_merge,
GtkActionGroup *action_group,
const gchar *filename);
void gnc_plugin_add_menu_tooltip_callbacks (GtkWidget *menubar,
GMenuModel *menubar_model,
GtkWidget *statusbar); //FIXMEb added
/** This function adds the tooltip callbacks to make the tooltips
* appear in the status bar.
*
* @param toolbar The main window tool bar widget.
*
* @param statusbar The status bar widget in the main window.
*/
void gnc_plugin_add_toolbar_tooltip_callbacks (GtkWidget *toolbar,
GtkWidget *statusbar); //FIXMEb added
G_END_DECLS
#endif /* __GNC_PLUGIN_H */

View File

@ -78,7 +78,7 @@ gnc_window_get_gtk_window (GncWindow *window)
return GNC_WINDOW_GET_IFACE (window)->get_gtk_window (window);
}
static GtkWidget *
GtkWidget *
gnc_window_get_statusbar (GncWindow *window)
{
g_return_val_if_fail(GNC_WINDOW (window), NULL);
@ -101,6 +101,42 @@ gnc_window_get_progressbar (GncWindow *window)
return GNC_WINDOW_GET_IFACE (window)->get_progressbar (window);
}
GtkWidget *
gnc_window_get_menubar (GncWindow *window)
{
g_return_val_if_fail (GNC_WINDOW(window), NULL);
/* optional */
if (GNC_WINDOW_GET_IFACE(window)->get_menubar == NULL)
return NULL;
return GNC_WINDOW_GET_IFACE(window)->get_menubar (window);
}
GtkWidget *
gnc_window_get_toolbar (GncWindow *window)
{
g_return_val_if_fail (GNC_WINDOW(window), NULL);
/* optional */
if (GNC_WINDOW_GET_IFACE(window)->get_toolbar == NULL)
return NULL;
return GNC_WINDOW_GET_IFACE(window)->get_toolbar (window);
}
GMenuModel *
gnc_window_get_menubar_model (GncWindow *window)
{
g_return_val_if_fail (GNC_WINDOW(window), NULL);
/* optional */
if (GNC_WINDOW_GET_IFACE(window)->get_menubar_model == NULL)
return NULL;
return GNC_WINDOW_GET_IFACE(window)->get_menubar_model (window);
}
/************************************************************
* Auxiliary status bar functions *
************************************************************/
@ -219,93 +255,3 @@ gnc_window_show_progress (const char *message, double percentage)
while (gtk_events_pending ())
gtk_main_iteration ();
}
/* CS: This callback functions will set the statusbar text to the
* "tooltip" property of the currently selected GtkAction.
*
* This code is directly copied from gtk+/test/testmerge.c.
* Thanks to (L)GPL! */
typedef struct _ActionStatus ActionStatus;
struct _ActionStatus
{
GtkAction *action;
GtkWidget *statusbar;
};
static void
action_status_destroy (gpointer data)
{
ActionStatus *action_status = data;
g_object_unref (action_status->action);
g_object_unref (action_status->statusbar);
g_free (action_status);
}
static void
set_tip (GtkWidget *widget)
{
ActionStatus *data;
gchar *tooltip;
data = g_object_get_data (G_OBJECT (widget), "action-status");
if (data)
{
g_object_get (data->action, "tooltip", &tooltip, NULL);
gtk_statusbar_push (GTK_STATUSBAR (data->statusbar), 0,
tooltip ? tooltip : " ");
g_free (tooltip);
}
}
static void
unset_tip (GtkWidget *widget)
{
ActionStatus *data;
data = g_object_get_data (G_OBJECT (widget), "action-status");
if (data)
gtk_statusbar_pop (GTK_STATUSBAR (data->statusbar), 0);
}
void
gnc_window_connect_proxy (GtkUIManager *merge,
GtkAction *action,
GtkWidget *proxy,
GtkWidget *statusbar)
{
if (GTK_IS_MENU_ITEM (proxy))
{
ActionStatus *data;
data = g_object_get_data (G_OBJECT (proxy), "action-status");
if (data)
{
g_object_unref (data->action);
g_object_unref (data->statusbar);
data->action = g_object_ref (action);
data->statusbar = g_object_ref (statusbar);
}
else
{
data = g_new0 (ActionStatus, 1);
data->action = g_object_ref (action);
data->statusbar = g_object_ref (statusbar);
g_object_set_data_full (G_OBJECT (proxy), "action-status",
data, action_status_destroy);
g_signal_connect (proxy, "select", G_CALLBACK (set_tip), NULL);
g_signal_connect (proxy, "deselect", G_CALLBACK (unset_tip), NULL);
}
}
}
/* CS: end copied code from gtk+/test/testmerge.c */

View File

@ -60,9 +60,12 @@ typedef struct
GTypeInterface parent;
/* Virtual Table */
GtkWindow * (* get_gtk_window) (GncWindow *window);
GtkWidget * (* get_statusbar) (GncWindow *window);
GtkWidget * (* get_progressbar) (GncWindow *window);
GtkWindow * (* get_gtk_window) (GncWindow *window);
GtkWidget * (* get_statusbar) (GncWindow *window);
GtkWidget * (* get_progressbar) (GncWindow *window);
GtkWidget * (* get_menubar) (GncWindow *window);
GtkWidget * (* get_toolbar) (GncWindow *window);
GMenuModel * (* get_menubar_model) (GncWindow *window);
void (* ui_set_sensitive) (GncWindow *window, gboolean sensitive);
} GncWindowIface;
@ -78,22 +81,10 @@ void gnc_window_set_progressbar_window (GncWindow *window);
GncWindow *gnc_window_get_progressbar_window (void);
GtkWidget *gnc_window_get_progressbar (GncWindow *window);
void gnc_window_show_progress (const char *message, double percentage);
/** This callback functions will set the statusbar text to the
* "tooltip" property of the currently selected GtkAction
*
* @param merge A pointer to the ui manager
*
* @param action A pointer to the action
*
* @param proxy A pointer to the proxy
*
* @param statusbar A pointer to the statusbar widget
*/
void gnc_window_connect_proxy (GtkUIManager *merge,
GtkAction *action,
GtkWidget *proxy,
GtkWidget *statusbar);
GtkWidget *gnc_window_get_menubar (GncWindow *window);
GtkWidget *gnc_window_get_toolbar (GncWindow *window);
GtkWidget *gnc_window_get_statusbar (GncWindow *window);
GMenuModel *gnc_window_get_menubar_model (GncWindow *window);
G_END_DECLS

View File

@ -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);
}

View File

@ -162,14 +162,14 @@ static gboolean sxed_confirmed_cancel (GncSxEditorDialog *sxed);
static gboolean editor_component_sx_equality (gpointer find_data,
gpointer user_data);
static GtkActionEntry gnc_sxed_menu_entries [] =
static GActionEntry gnc_sxed_menu_entries [] =
{
{ "EditAction", NULL, N_("_Edit"), NULL, NULL, NULL },
{ "TransactionAction", NULL, N_("_Transaction"), NULL, NULL, NULL },
{ "ViewAction", NULL, N_("_View"), NULL, NULL, NULL },
{ "ActionsAction", NULL, N_("_Actions"), NULL, NULL, NULL },
{ "EditAction", NULL, NULL, NULL, NULL },
{ "TransactionAction", NULL, NULL, NULL, NULL },
{ "ViewAction", NULL, NULL, NULL, NULL },
{ "ActionsAction", NULL, NULL, NULL, NULL },
};
static guint gnc_sxed_menu_n_entries = G_N_ELEMENTS (gnc_sxed_menu_entries);
static guint gnc_sxed_menu_n_entries = G_N_ELEMENTS(gnc_sxed_menu_entries);
/** Implementations *****************************************************/
@ -1284,7 +1284,7 @@ gnc_ui_scheduled_xaction_editor_dialog_create (GtkWindow *parent,
/* populate */
schedXact_editor_populate (sxed);
/* Do not call show_all here. Screws up the gtkuimanager code */
/* Do not call show_all here */
gtk_widget_show (sxed->dialog);
gtk_notebook_set_current_page (GTK_NOTEBOOK (sxed->notebook), 0);
@ -1355,10 +1355,10 @@ schedXact_editor_create_ledger (GncSxEditorDialog *sxed)
/* First the embedded window */
main_vbox = GTK_WIDGET (gtk_builder_get_object (sxed->builder, "register_vbox"));
sxed->embed_window =
gnc_embedded_window_new ("SXWindowActions",
gnc_embedded_window_new ("embedded-win",
gnc_sxed_menu_entries,
gnc_sxed_menu_n_entries,
"gnc-sxed-window-ui.xml",
"gnc-embedded-register-window.ui",
sxed->dialog,
FALSE, /* no accelerators */
sxed);
@ -1367,8 +1367,11 @@ schedXact_editor_create_ledger (GncSxEditorDialog *sxed)
/* Now create the register plugin page. */
sxed->plugin_page = gnc_plugin_page_register_new_ledger (sxed->ledger);
gnc_plugin_page_set_ui_description (sxed->plugin_page,
"gnc-sxed-window-ui-full.xml");
gtk_widget_insert_action_group (GTK_WIDGET(sxed->embed_window),
gnc_plugin_page_get_simple_action_group_name (sxed->plugin_page),
G_ACTION_GROUP(gnc_plugin_page_get_action_group (sxed->plugin_page)));
gnc_plugin_page_register_set_options (sxed->plugin_page,
NUM_LEDGER_LINES_DEFAULT, FALSE);
gnc_embedded_window_open_page (sxed->embed_window, sxed->plugin_page);

View File

@ -46,24 +46,26 @@ static void gnc_plugin_account_tree_init (GncPluginAccountTree *plugin);
static void gnc_plugin_account_tree_finalize (GObject *object);
/* Command callbacks */
static void gnc_plugin_account_tree_cmd_new_account_tree (GtkAction *action, GncMainWindowActionData *data);
static void gnc_plugin_account_tree_cmd_new_account_tree (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
#define PLUGIN_ACTIONS_NAME "gnc-plugin-account-tree-actions"
#define PLUGIN_UI_FILENAME "gnc-plugin-account-tree-ui.xml"
#define PLUGIN_UI_FILENAME "gnc-plugin-account-tree.ui"
/** An array of all of the actions provided by the account tree
* plugin. */
static GtkActionEntry gnc_plugin_actions [] =
static GActionEntry gnc_plugin_actions [] =
{
{
"ViewAccountTreeAction", NULL, N_("New Accounts _Page"), NULL,
N_("Open a new Account Tree page"),
G_CALLBACK (gnc_plugin_account_tree_cmd_new_account_tree)
},
{ "ViewAccountTreeAction", gnc_plugin_account_tree_cmd_new_account_tree, NULL, NULL, NULL },
};
/** The number of actions provided by this plugin. */
static guint gnc_plugin_n_actions = G_N_ELEMENTS (gnc_plugin_actions);
static guint gnc_plugin_n_actions = G_N_ELEMENTS(gnc_plugin_actions);
/** The default menu items that need to be add to the menu */
static const gchar *gnc_plugin_load_ui_items [] =
{
"ViewPlaceholder5",
NULL,
};
/** The instance private data structure for an account tree plugin. */
typedef struct GncPluginAccountTreePrivate
@ -117,10 +119,11 @@ gnc_plugin_account_tree_class_init (GncPluginAccountTreeClass *klass)
plugin_class->plugin_name = GNC_PLUGIN_ACCOUNT_TREE_NAME;
/* widget addition/removal */
plugin_class->actions_name = PLUGIN_ACTIONS_NAME;
plugin_class->actions = gnc_plugin_actions;
plugin_class->n_actions = gnc_plugin_n_actions;
plugin_class->ui_filename = PLUGIN_UI_FILENAME;
plugin_class->actions_name = PLUGIN_ACTIONS_NAME;
plugin_class->actions = gnc_plugin_actions;
plugin_class->n_actions = gnc_plugin_n_actions;
plugin_class->ui_filename = PLUGIN_UI_FILENAME;
plugin_class->ui_updates = gnc_plugin_load_ui_items;
}
@ -156,9 +159,11 @@ gnc_plugin_account_tree_finalize (GObject *object)
************************************************************/
static void
gnc_plugin_account_tree_cmd_new_account_tree (GtkAction *action,
GncMainWindowActionData *data)
gnc_plugin_account_tree_cmd_new_account_tree (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
GncMainWindowActionData *data = user_data;
GncPluginPage *page;
g_return_if_fail (data != NULL);

View File

@ -71,171 +71,78 @@ static void gnc_plugin_basic_commands_add_to_window (GncPlugin *plugin, GncMainW
static void gnc_plugin_basic_commands_main_window_page_changed(GncMainWindow *window, GncPluginPage *page, gpointer user_data);
/* Command callbacks */
static void gnc_main_window_cmd_file_new (GtkAction *action, GncMainWindowActionData *data);
static void gnc_main_window_cmd_file_open (GtkAction *action, GncMainWindowActionData *data);
static void gnc_main_window_cmd_file_save (GtkAction *action, GncMainWindowActionData *data);
static void gnc_main_window_cmd_file_save_as (GtkAction *action, GncMainWindowActionData *data);
static void gnc_main_window_cmd_file_revert (GtkAction *action, GncMainWindowActionData *data);
static void gnc_main_window_cmd_file_export_accounts (GtkAction *action, GncMainWindowActionData *data);
static void gnc_main_window_cmd_edit_tax_options (GtkAction *action, GncMainWindowActionData *data);
static void gnc_main_window_cmd_actions_mortgage_loan (GtkAction *action, GncMainWindowActionData *data);
static void gnc_main_window_cmd_actions_scheduled_transaction_editor (GtkAction *action, GncMainWindowActionData *data);
static void gnc_main_window_cmd_actions_since_last_run (GtkAction *action, GncMainWindowActionData *data);
static void gnc_main_window_cmd_file_new (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
static void gnc_main_window_cmd_file_open (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
static void gnc_main_window_cmd_file_save (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
static void gnc_main_window_cmd_file_save_as (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
static void gnc_main_window_cmd_file_revert (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
static void gnc_main_window_cmd_file_export_accounts (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
static void gnc_main_window_cmd_edit_tax_options (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
static void gnc_main_window_cmd_actions_mortgage_loan (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
static void gnc_main_window_cmd_actions_scheduled_transaction_editor (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
static void gnc_main_window_cmd_actions_since_last_run (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
#if CLOSE_BOOKS_ACTUALLY_WORKS
static void gnc_main_window_cmd_actions_close_books (GtkAction *action, GncMainWindowActionData *data);
static void gnc_main_window_cmd_actions_close_books (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
#endif /* CLOSE_BOOKS_ACTUALLY_WORKS */
static void gnc_main_window_cmd_tools_financial_calculator (GtkAction *action, GncMainWindowActionData *data);
static void gnc_main_window_cmd_tools_close_book (GtkAction *action, GncMainWindowActionData *data);
static void gnc_main_window_cmd_tools_find_transactions (GtkAction *action, GncMainWindowActionData *data);
static void gnc_main_window_cmd_tools_price_editor (GtkAction *action, GncMainWindowActionData *data);
static void gnc_main_window_cmd_tools_imap_editor (GtkAction *action, GncMainWindowActionData *data);
static void gnc_main_window_cmd_tools_trans_doclink (GtkAction *action, GncMainWindowActionData *data);
static void gnc_main_window_cmd_tools_commodity_editor (GtkAction *action, GncMainWindowActionData *data);
static void gnc_main_window_cmd_help_totd (GtkAction *action, GncMainWindowActionData *data);
static void gnc_main_window_cmd_tools_financial_calculator (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
static void gnc_main_window_cmd_tools_close_book (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
static void gnc_main_window_cmd_tools_find_transactions (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
static void gnc_main_window_cmd_tools_price_editor (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
static void gnc_main_window_cmd_tools_imap_editor (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
static void gnc_main_window_cmd_tools_trans_doclink (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
static void gnc_main_window_cmd_tools_commodity_editor (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
static void gnc_main_window_cmd_help_totd (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
#define PLUGIN_ACTIONS_NAME "gnc-plugin-basic-commands-actions"
#define PLUGIN_UI_FILENAME "gnc-plugin-basic-commands-ui.xml"
#define PLUGIN_UI_FILENAME "gnc-plugin-basic-commands.ui"
/** An array of all of the actions provided by the basic commands
* plugin. */
static GtkActionEntry gnc_plugin_actions [] =
static GActionEntry gnc_plugin_actions [] =
{
/* File menu */
{
"FileNewAction", "document-new", N_("New _File"), "<primary>n",
N_("Create a new file"),
G_CALLBACK (gnc_main_window_cmd_file_new)
},
{
"FileOpenAction", "document-open", N_("_Open…"), "<primary>o",
N_("Open an existing GnuCash file"),
G_CALLBACK (gnc_main_window_cmd_file_open)
},
{
"FileSaveAction", "document-save", N_("_Save"), "<primary>s",
N_("Save the current file"),
G_CALLBACK (gnc_main_window_cmd_file_save)
},
{
"FileSaveAsAction", "document-save-as", N_("Save _As…"), "<shift><primary>s",
N_("Save this file with a different name"),
G_CALLBACK (gnc_main_window_cmd_file_save_as)
},
{
"FileRevertAction", "document-revert", N_("Re_vert"), NULL,
N_("Reload the current database, reverting all unsaved changes"),
G_CALLBACK (gnc_main_window_cmd_file_revert)
},
{
"FileExportAccountsAction", "go-next",
N_("Export _Accounts"), NULL,
N_("Export the account hierarchy to a new GnuCash datafile"),
G_CALLBACK (gnc_main_window_cmd_file_export_accounts)
},
/* Edit menu */
{
"EditFindTransactionsAction", "edit-find", N_("_Find…"), "<primary>f",
N_("Find transactions with a search"),
G_CALLBACK (gnc_main_window_cmd_tools_find_transactions)
},
{
"EditTaxOptionsAction", NULL,
/* Translators: remember to reuse this
translation in dialog-account.glade */
N_("Ta_x Report Options"), NULL,
/* Translators: currently implemented are
US: income tax and
DE: VAT
So adjust this string */
N_("Setup relevant accounts for tax reports, e.g. US income tax"),
G_CALLBACK (gnc_main_window_cmd_edit_tax_options)
},
/* Actions menu */
{ "ActionsScheduledTransactionsAction", NULL, N_("_Scheduled Transactions"), NULL, NULL, NULL },
{
"ActionsScheduledTransactionEditorAction", NULL, N_("_Scheduled Transaction Editor"), NULL,
N_("The list of Scheduled Transactions"),
G_CALLBACK (gnc_main_window_cmd_actions_scheduled_transaction_editor)
},
{
"ActionsSinceLastRunAction", NULL, N_("Since _Last Run…"), NULL,
N_("Create Scheduled Transactions since the last time run"),
G_CALLBACK (gnc_main_window_cmd_actions_since_last_run)
},
{
"ActionsMortgageLoanAction", NULL, N_("_Mortgage & Loan Repayment…"), NULL,
N_("Setup scheduled transactions for repayment of a loan"),
G_CALLBACK (gnc_main_window_cmd_actions_mortgage_loan)
},
{ "ActionsBudgetAction", NULL, N_("B_udget"), NULL, NULL, NULL },
{ "FileNewAction", gnc_main_window_cmd_file_new, NULL, NULL, NULL },
{ "FileOpenAction", gnc_main_window_cmd_file_open, NULL, NULL, NULL },
{ "FileSaveAction", gnc_main_window_cmd_file_save, NULL, NULL, NULL },
{ "FileSaveAsAction", gnc_main_window_cmd_file_save_as, NULL, NULL, NULL },
{ "FileRevertAction", gnc_main_window_cmd_file_revert, NULL, NULL, NULL },
{ "FileExportAccountsAction", gnc_main_window_cmd_file_export_accounts, NULL, NULL, NULL },
{ "EditFindTransactionsAction", gnc_main_window_cmd_tools_find_transactions, NULL, NULL, NULL },
{ "EditTaxOptionsAction", gnc_main_window_cmd_edit_tax_options, NULL, NULL, NULL },
{ "ActionsScheduledTransactionsAction", NULL, NULL, NULL, NULL },
{ "ActionsScheduledTransactionEditorAction", gnc_main_window_cmd_actions_scheduled_transaction_editor, NULL, NULL, NULL },
{ "ActionsSinceLastRunAction", gnc_main_window_cmd_actions_since_last_run, NULL, NULL, NULL },
{ "ActionsMortgageLoanAction", gnc_main_window_cmd_actions_mortgage_loan, NULL, NULL, NULL },
{ "ActionsBudgetAction", NULL, NULL, NULL, NULL },
#ifdef CLOSE_BOOKS_ACTUALLY_WORKS
{
"ActionsCloseBooksAction", NULL, N_("Close _Books"), NULL,
N_("Archive old data using accounting periods"),
G_CALLBACK (gnc_main_window_cmd_actions_close_books)
},
{ "ActionsCloseBooksAction", gnc_main_window_cmd_actions_close_books, NULL, NULL, NULL },
#endif // CLOSE_BOOKS_ACTUALLY_WORKS
/* Tools menu */
{
"ToolsPriceEditorAction", NULL, N_("_Price Database"), NULL,
N_("View and edit the prices for stocks and mutual funds"),
G_CALLBACK (gnc_main_window_cmd_tools_price_editor)
},
{
"ToolsCommodityEditorAction", NULL, N_("_Security Editor"), NULL,
N_("View and edit the commodities for stocks and mutual funds"),
G_CALLBACK (gnc_main_window_cmd_tools_commodity_editor)
},
{
"ToolsFinancialCalculatorAction", NULL, N_("_Loan Repayment Calculator"), NULL,
N_("Use the loan/mortgage repayment calculator"),
G_CALLBACK (gnc_main_window_cmd_tools_financial_calculator)
},
{
"ToolsBookCloseAction", NULL, N_("_Close Book"), NULL,
N_("Close the Book at the end of the Period"),
G_CALLBACK (gnc_main_window_cmd_tools_close_book)
},
{
"ToolsImapEditorAction", NULL, N_("_Import Map Editor"), NULL,
N_("View and Delete Bayesian and non-Bayesian information"),
G_CALLBACK (gnc_main_window_cmd_tools_imap_editor)
},
{
"ToolsTransLinkedDocsAction", NULL, N_("_Transaction Linked Documents"), NULL,
N_("View all Transaction Linked Documents"),
G_CALLBACK (gnc_main_window_cmd_tools_trans_doclink)
},
/* Help menu */
{
"HelpTipsOfTheDayAction", NULL, N_("_Tips Of The Day"), NULL,
N_("View the Tips of the Day"),
G_CALLBACK (gnc_main_window_cmd_help_totd)
},
{ "ToolsPriceEditorAction", gnc_main_window_cmd_tools_price_editor, NULL, NULL, NULL },
{ "ToolsCommodityEditorAction", gnc_main_window_cmd_tools_commodity_editor, NULL, NULL, NULL },
{ "ToolsFinancialCalculatorAction", gnc_main_window_cmd_tools_financial_calculator, NULL, NULL, NULL },
{ "ToolsBookCloseAction", gnc_main_window_cmd_tools_close_book, NULL, NULL, NULL },
{ "ToolsImapEditorAction", gnc_main_window_cmd_tools_imap_editor, NULL, NULL, NULL },
{ "ToolsTransLinkedDocsAction", gnc_main_window_cmd_tools_trans_doclink, NULL, NULL, NULL },
{ "HelpTipsOfTheDayAction", gnc_main_window_cmd_help_totd, NULL, NULL, NULL },
};
/** The number of actions provided by this plugin. */
static guint gnc_plugin_n_actions = G_N_ELEMENTS (gnc_plugin_actions);
static guint gnc_plugin_n_actions = G_N_ELEMENTS(gnc_plugin_actions);
/** These are the "important" actions provided by the basic commands
* plugin. Their labels will appear when the toolbar is set to
* "Icons and important text" (e.g. GTK_TOOLBAR_BOTH_HORIZ) mode. */
static const gchar *gnc_plugin_important_actions[] =
/** The default menu items that need to be add to the menu */
static const gchar *gnc_plugin_load_ui_items [] =
{
"FileSaveAction",
"FilePlaceholder0",
"FilePlaceholder2",
"FilePlaceholder3",
"FilePlaceholder5",
"EditPlaceholder3",
"EditPlaceholder5",
"ActionsPlaceholder2",
"ToolsPlaceholder1",
"HelpPlaceholder1",
NULL,
};
@ -278,7 +185,7 @@ typedef struct GncPluginBasicCommandsPrivate
} GncPluginBasicCommandsPrivate;
#define GNC_PLUGIN_BASIC_COMMANDS_GET_PRIVATE(o) \
((GncPluginBasicCommandsPrivate*)gnc_plugin_basic_commands_get_instance_private((GncPluginBasicCommands*)o))
((GncPluginBasicCommandsPrivate*)gnc_plugin_basic_commands_get_instance_private ((GncPluginBasicCommands*)o))
/** A pointer to the parent class of a plugin page. */
static GObjectClass *parent_class = NULL;
@ -314,25 +221,27 @@ gnc_plugin_basic_commands_new (void)
*/
static void
gnc_plugin_basic_commands_add_to_window (GncPlugin *plugin,
GncMainWindow *window,
GQuark type)
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_set_actions_enabled (G_ACTION_MAP(simple_action_group),
gnc_plugin_initially_insensitive_actions,
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)
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());
@ -344,26 +253,26 @@ 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,
"sensitive", is_readwrite);
gnc_plugin_update_actions (action_group, dirty_only_active_actions,
"sensitive", is_dirty);
gnc_plugin_set_actions_enabled (G_ACTION_MAP(simple_action_group), readwrite_only_active_actions,
is_readwrite);
gnc_plugin_set_actions_enabled (G_ACTION_MAP(simple_action_group), dirty_only_active_actions,
is_dirty);
}
static void
gnc_plugin_basic_commands_main_window_page_changed(GncMainWindow *window,
GncPluginPage *page,
gpointer user_data)
gnc_plugin_basic_commands_main_window_page_changed (GncMainWindow *window,
GncPluginPage *plugin_page,
gpointer user_data)
{
/* Make sure not to call this with a NULL GncPluginPage */
if (page)
if (plugin_page)
{
// Update the action sensitivity due to read-only
update_inactive_actions(page);
update_inactive_actions (plugin_page);
}
}
@ -393,11 +302,11 @@ gnc_plugin_basic_commands_class_init (GncPluginBasicCommandsClass *klass)
plugin_class->add_to_window = gnc_plugin_basic_commands_add_to_window;
/* widget addition/removal */
plugin_class->actions_name = PLUGIN_ACTIONS_NAME;
plugin_class->actions = gnc_plugin_actions;
plugin_class->n_actions = gnc_plugin_n_actions;
plugin_class->important_actions = gnc_plugin_important_actions;
plugin_class->actions_name = PLUGIN_ACTIONS_NAME;
plugin_class->actions = gnc_plugin_actions;
plugin_class->n_actions = gnc_plugin_n_actions;
plugin_class->ui_filename = PLUGIN_UI_FILENAME;
plugin_class->ui_updates = gnc_plugin_load_ui_items;
}
@ -423,9 +332,9 @@ gnc_plugin_basic_commands_init (GncPluginBasicCommands *plugin)
static void
gnc_plugin_basic_commands_finalize (GObject *object)
{
g_return_if_fail (GNC_IS_PLUGIN_BASIC_COMMANDS (object));
g_return_if_fail (GNC_IS_PLUGIN_BASIC_COMMANDS(object));
G_OBJECT_CLASS (parent_class)->finalize (object);
G_OBJECT_CLASS(parent_class)->finalize (object);
}
/************************************************************
@ -433,20 +342,28 @@ gnc_plugin_basic_commands_finalize (GObject *object)
************************************************************/
static void
gnc_main_window_cmd_file_new (GtkAction *action, GncMainWindowActionData *data)
gnc_main_window_cmd_file_new (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
if (!gnc_main_window_all_finish_pending())
GncMainWindowActionData *data = user_data;
if (!gnc_main_window_all_finish_pending ())
return;
gnc_file_new (GTK_WINDOW (data->window));
gnc_file_new (GTK_WINDOW(data->window));
}
static void
gnc_main_window_cmd_file_open (GtkAction *action, GncMainWindowActionData *data)
gnc_main_window_cmd_file_open (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
GncMainWindowActionData *data = user_data;
g_return_if_fail (data != NULL);
if (!gnc_main_window_all_finish_pending())
if (!gnc_main_window_all_finish_pending ())
return;
/* Reset the flag that indicates the conversion of the bayes KVP
@ -455,88 +372,114 @@ gnc_main_window_cmd_file_open (GtkAction *action, GncMainWindowActionData *data)
gnc_window_set_progressbar_window (GNC_WINDOW(data->window));
#ifdef HAVE_DBI_DBI_H
gnc_ui_file_access_for_open (GTK_WINDOW (data->window));
gnc_ui_file_access_for_open (GTK_WINDOW(data->window));
#else
gnc_file_open (GTK_WINDOW (data->window));
gnc_file_open (GTK_WINDOW(data->window));
#endif
gnc_window_set_progressbar_window (NULL);
}
static void
gnc_main_window_cmd_file_save (GtkAction *action, GncMainWindowActionData *data)
gnc_main_window_cmd_file_save (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
GncMainWindowActionData *data = user_data;
g_return_if_fail (data != NULL);
if (!gnc_main_window_all_finish_pending())
if (!gnc_main_window_all_finish_pending ())
return;
gnc_window_set_progressbar_window (GNC_WINDOW(data->window));
gnc_file_save (GTK_WINDOW (data->window));
gnc_file_save (GTK_WINDOW(data->window));
gnc_window_set_progressbar_window (NULL);
}
static void
gnc_main_window_cmd_file_save_as (GtkAction *action, GncMainWindowActionData *data)
gnc_main_window_cmd_file_save_as (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
GncMainWindowActionData *data = user_data;
g_return_if_fail (data != NULL);
if (!gnc_main_window_all_finish_pending())
if (!gnc_main_window_all_finish_pending ())
return;
gnc_window_set_progressbar_window (GNC_WINDOW(data->window));
#ifdef HAVE_DBI_DBI_H
gnc_ui_file_access_for_save_as (GTK_WINDOW (data->window));
gnc_ui_file_access_for_save_as (GTK_WINDOW(data->window));
#else
gnc_file_save_as (GTK_WINDOW (data->window));
gnc_file_save_as (GTK_WINDOW(data->window));
#endif
gnc_window_set_progressbar_window (NULL);
}
static void
gnc_main_window_cmd_file_revert (GtkAction *action, GncMainWindowActionData *data)
gnc_main_window_cmd_file_revert (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
GncMainWindowActionData *data = user_data;
g_return_if_fail (data != NULL);
if (!gnc_main_window_all_finish_pending())
if (!gnc_main_window_all_finish_pending ())
return;
gnc_window_set_progressbar_window (GNC_WINDOW(data->window));
gnc_file_revert(GTK_WINDOW (data->window));
gnc_file_revert (GTK_WINDOW(data->window));
gnc_window_set_progressbar_window (NULL);
}
static void
gnc_main_window_cmd_file_export_accounts (GtkAction *action, GncMainWindowActionData *data)
gnc_main_window_cmd_file_export_accounts (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
GncMainWindowActionData *data = user_data;
g_return_if_fail (data != NULL);
gnc_window_set_progressbar_window (GNC_WINDOW(data->window));
#ifdef HAVE_DBI_DBI_H
gnc_ui_file_access_for_export (GTK_WINDOW (data->window));
gnc_ui_file_access_for_export (GTK_WINDOW(data->window));
#else
gnc_file_export (GTK_WINDOW (data->window));
gnc_file_export (GTK_WINDOW(data->window));
#endif
gnc_window_set_progressbar_window (NULL);
}
static void
gnc_main_window_cmd_edit_tax_options (GtkAction *action, GncMainWindowActionData *data)
gnc_main_window_cmd_edit_tax_options (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
GncMainWindowActionData *data = user_data;
g_return_if_fail (data != NULL);
gnc_tax_info_dialog (GTK_WIDGET (data->window), NULL);
gnc_tax_info_dialog (GTK_WIDGET(data->window), NULL);
}
static void
gnc_main_window_cmd_actions_scheduled_transaction_editor (GtkAction *action, GncMainWindowActionData *data)
gnc_main_window_cmd_actions_scheduled_transaction_editor (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
GncPluginPage *page = gnc_plugin_page_sx_list_new();
gnc_main_window_open_page(NULL, page);
GncMainWindowActionData *data = user_data;
GncPluginPage *page = gnc_plugin_page_sx_list_new ();
gnc_main_window_open_page (NULL, page);
}
static void
gnc_main_window_cmd_actions_since_last_run (GtkAction *action, GncMainWindowActionData *data)
gnc_main_window_cmd_actions_since_last_run (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
GncMainWindowActionData *data = user_data;
GtkWindow *window;
GncSxInstanceModel *sx_instances;
GncSxSummary summary;
@ -546,9 +489,9 @@ gnc_main_window_cmd_actions_since_last_run (GtkAction *action, GncMainWindowActi
g_return_if_fail (data != NULL);
window = GTK_WINDOW (data->window);
window = GTK_WINDOW(data->window);
if (qof_book_is_readonly(gnc_get_current_book()))
if (qof_book_is_readonly (gnc_get_current_book()))
{
/* Is the book read-only? Then don't change anything here. */
return;
@ -574,97 +517,122 @@ gnc_main_window_cmd_actions_since_last_run (GtkAction *action, GncMainWindowActi
}
else
{
gnc_info_dialog(window, ngettext
/* Translators: %d is the number of transactions. This is a
ngettext(3) message. */
("There are no Scheduled Transactions to be entered at this time. "
"(%d transaction automatically created)",
"There are no Scheduled Transactions to be entered at this time. "
"(%d transactions automatically created)",
summary.num_auto_create_no_notify_instances),
summary.num_auto_create_no_notify_instances);
gnc_info_dialog (window, ngettext
/* Translators: %d is the number of transactions. This is a
ngettext(3) message. */
("There are no Scheduled Transactions to be entered at this time. "
"(%d transaction automatically created)",
"There are no Scheduled Transactions to be entered at this time. "
"(%d transactions automatically created)",
summary.num_auto_create_no_notify_instances),
summary.num_auto_create_no_notify_instances);
}
}
g_list_free(auto_created_txns);
g_object_unref(G_OBJECT(sx_instances));
g_list_free (auto_created_txns);
g_object_unref (G_OBJECT(sx_instances));
}
static void
gnc_main_window_cmd_actions_mortgage_loan (GtkAction *action, GncMainWindowActionData *data)
gnc_main_window_cmd_actions_mortgage_loan (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
GncMainWindowActionData *data = user_data;
gnc_ui_sx_loan_assistant_create ();
}
#ifdef CLOSE_BOOKS_ACTUALLY_WORKS
static void
gnc_main_window_cmd_actions_close_books (GtkAction *action, GncMainWindowActionData *data)
gnc_main_window_cmd_actions_close_books (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
gnc_acct_period_dialog();
GncMainWindowActionData *data = user_data;
gnc_acct_period_dialog ();
}
#endif /* CLOSE_BOOKS_ACTUALLY_WORKS */
static void
gnc_main_window_cmd_tools_imap_editor (GtkAction *action, GncMainWindowActionData *data)
{
gnc_set_busy_cursor(NULL, TRUE);
gnc_imap_dialog (GTK_WIDGET (data->window));
gnc_unset_busy_cursor(NULL);
}
static void
gnc_main_window_cmd_tools_trans_doclink (GtkAction *action, GncMainWindowActionData *data)
gnc_main_window_cmd_tools_imap_editor (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
GncMainWindowActionData *data = user_data;
gnc_set_busy_cursor (NULL, TRUE);
gnc_doclink_trans_dialog (GTK_WINDOW (data->window));
gnc_imap_dialog (GTK_WIDGET(data->window));
gnc_unset_busy_cursor (NULL);
}
static void
gnc_main_window_cmd_tools_price_editor (GtkAction *action, GncMainWindowActionData *data)
gnc_main_window_cmd_tools_trans_doclink (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
gnc_set_busy_cursor(NULL, TRUE);
gnc_prices_dialog (GTK_WIDGET (data->window));
gnc_unset_busy_cursor(NULL);
GncMainWindowActionData *data = user_data;
gnc_set_busy_cursor (NULL, TRUE);
gnc_doclink_trans_dialog (GTK_WINDOW(data->window));
gnc_unset_busy_cursor (NULL);
}
static void
gnc_main_window_cmd_tools_commodity_editor (GtkAction *action, GncMainWindowActionData *data)
gnc_main_window_cmd_tools_price_editor (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
gnc_set_busy_cursor(NULL, TRUE);
gnc_commodities_dialog (GTK_WIDGET (data->window));
gnc_unset_busy_cursor(NULL);
GncMainWindowActionData *data = user_data;
gnc_set_busy_cursor (NULL, TRUE);
gnc_prices_dialog (GTK_WIDGET(data->window));
gnc_unset_busy_cursor (NULL);
}
static void
gnc_main_window_cmd_tools_financial_calculator (GtkAction *action, GncMainWindowActionData *data)
gnc_main_window_cmd_tools_commodity_editor (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
gnc_ui_fincalc_dialog_create(GTK_WINDOW (data->window));
GncMainWindowActionData *data = user_data;
gnc_set_busy_cursor (NULL, TRUE);
gnc_commodities_dialog (GTK_WIDGET(data->window));
gnc_unset_busy_cursor (NULL);
}
static void
gnc_main_window_cmd_tools_close_book (GtkAction *action, GncMainWindowActionData *data)
gnc_main_window_cmd_tools_financial_calculator (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
gnc_ui_close_book(gnc_get_current_book(), GTK_WINDOW (data->window));
GncMainWindowActionData *data = user_data;
gnc_ui_fincalc_dialog_create (GTK_WINDOW(data->window));
}
static void
gnc_main_window_cmd_tools_find_transactions (GtkAction *action, GncMainWindowActionData *data)
gnc_main_window_cmd_tools_close_book (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
GncMainWindowActionData *data = user_data;
gnc_ui_close_book (gnc_get_current_book(), GTK_WINDOW(data->window));
}
static void
gnc_main_window_cmd_tools_find_transactions (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
GncMainWindowActionData *data = user_data;
#ifdef REGISTER2_ENABLED
/*################## Added for Reg2 #################*/
gnc_ui_find_transactions_dialog_create2 (NULL);
/*################## Added for Reg2 #################*/
#else
gnc_ui_find_transactions_dialog_create (GTK_WINDOW(data->window), NULL);
#endif
}
static void
gnc_main_window_cmd_help_totd (GtkAction *action, GncMainWindowActionData *data)
gnc_main_window_cmd_help_totd (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
GncMainWindowActionData *data = user_data;
g_return_if_fail (data != NULL);
gnc_totd_dialog(GTK_WINDOW(data->window), FALSE);
gnc_totd_dialog (GTK_WINDOW(data->window), FALSE);
}
/** @} */

View File

@ -38,7 +38,7 @@
#include "gnc-component-manager.h"
#define PLUGIN_ACTIONS_NAME "gnc-plugin-budget-actions"
#define PLUGIN_UI_FILENAME "gnc-plugin-budget-ui.xml"
#define PLUGIN_UI_FILENAME "gnc-plugin-budget.ui"
static QofLogModule log_module = GNC_MOD_GUI;
@ -49,43 +49,29 @@ static void gnc_plugin_budget_add_to_window (GncPlugin *plugin,
GncMainWindow *window, GQuark type);
/* Command Callbacks */
static void gnc_plugin_budget_cmd_new_budget (GtkAction *action,
GncMainWindowActionData *data);
static void gnc_plugin_budget_cmd_open_budget (GtkAction *action,
GncMainWindowActionData *data);
static void gnc_plugin_budget_cmd_copy_budget (GtkAction *action,
GncMainWindowActionData *data);
static void gnc_plugin_budget_cmd_delete_budget (GtkAction *action,
GncMainWindowActionData *data);
static void gnc_plugin_budget_cmd_new_budget (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
static void gnc_plugin_budget_cmd_open_budget (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
static void gnc_plugin_budget_cmd_copy_budget (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
static void gnc_plugin_budget_cmd_delete_budget (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
static GtkActionEntry gnc_plugin_actions [] =
static GActionEntry gnc_plugin_actions [] =
{
{
"NewBudgetAction", NULL, N_("_New Budget"), NULL,
N_("Create a new Budget."),
G_CALLBACK(gnc_plugin_budget_cmd_new_budget)
},
{
"OpenBudgetAction", NULL, N_("_Open Budget"), NULL,
N_("Open an existing Budget in a new tab. If none exists a new budget will be created."),
G_CALLBACK(gnc_plugin_budget_cmd_open_budget)
},
{
"CopyBudgetAction", NULL, N_("_Copy Budget"), NULL,
N_("Copy an existing Budget."),
G_CALLBACK(gnc_plugin_budget_cmd_copy_budget)
},
{
"DeleteBudgetAction", NULL, N_("_Delete Budget"), NULL,
N_("Delete an existing Budget."),
G_CALLBACK(gnc_plugin_budget_cmd_delete_budget)
},
{ "ActionsBudgetAction", NULL, NULL, NULL, NULL },
{ "NewBudgetAction", gnc_plugin_budget_cmd_new_budget, NULL, NULL, NULL },
{ "OpenBudgetAction", gnc_plugin_budget_cmd_open_budget, NULL, NULL, NULL },
{ "CopyBudgetAction", gnc_plugin_budget_cmd_copy_budget, NULL, NULL, NULL },
{ "DeleteBudgetAction", gnc_plugin_budget_cmd_delete_budget, NULL, NULL, NULL },
};
static guint gnc_plugin_n_actions = G_N_ELEMENTS (gnc_plugin_actions);
/** The number of actions provided by this plugin. */
static guint gnc_plugin_n_actions = G_N_ELEMENTS(gnc_plugin_actions);
/** The default menu items that need to be add to the menu */
static const gchar *gnc_plugin_load_ui_items [] =
{
"ActionsPlaceholder3",
NULL,
};
static const gchar *plugin_writeable_actions[] =
{
@ -106,7 +92,8 @@ typedef struct GncPluginBudgetPrivate
static GObjectClass *parent_class = NULL;
GncPlugin * gnc_plugin_budget_new (void)
GncPlugin *
gnc_plugin_budget_new (void)
{
GncPluginBudget *plugin;
ENTER(" ");
@ -120,23 +107,25 @@ GncPlugin * gnc_plugin_budget_new (void)
return GNC_PLUGIN(plugin);
}
static void page_changed (GncMainWindow *window, GncPluginPage *page,
gpointer user_data)
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);
if (qof_book_is_readonly (gnc_get_current_book()))
gnc_plugin_update_actions (action_group, plugin_writeable_actions,
"sensitive", FALSE);
gnc_plugin_set_actions_enabled (G_ACTION_MAP(simple_action_group), plugin_writeable_actions,
FALSE);
}
static void add_to_window (GncPlugin *plugin, GncMainWindow *mainwindow, GQuark type)
static void
add_to_window (GncPlugin *plugin, GncMainWindow *mainwindow, GQuark type)
{
g_signal_connect (mainwindow, "page_changed", G_CALLBACK (page_changed), plugin);
}
static void remove_from_window (GncPlugin *plugin, GncMainWindow *window, GQuark type)
static void
remove_from_window (GncPlugin *plugin, GncMainWindow *window, GQuark type)
{
g_signal_handlers_disconnect_by_func (window, G_CALLBACK(page_changed), plugin);
}
@ -153,12 +142,13 @@ gnc_plugin_budget_class_init (GncPluginBudgetClass *klass)
parent_class = g_type_class_peek_parent (klass);
object_class->finalize = gnc_plugin_budget_finalize;
plugin_class->plugin_name = GNC_PLUGIN_BUDGET_NAME;
plugin_class->actions_name = PLUGIN_ACTIONS_NAME;
plugin_class->actions = gnc_plugin_actions;
plugin_class->n_actions = gnc_plugin_n_actions;
plugin_class->ui_filename = PLUGIN_UI_FILENAME;
plugin_class->add_to_window = add_to_window;
plugin_class->plugin_name = GNC_PLUGIN_BUDGET_NAME;
plugin_class->actions_name = PLUGIN_ACTIONS_NAME;
plugin_class->actions = gnc_plugin_actions;
plugin_class->n_actions = gnc_plugin_n_actions;
plugin_class->ui_filename = PLUGIN_UI_FILENAME;
plugin_class->ui_updates = gnc_plugin_load_ui_items;
plugin_class->add_to_window = add_to_window;
plugin_class->remove_from_window = remove_from_window;
LEAVE (" ");
@ -186,15 +176,17 @@ gnc_plugin_budget_finalize (GObject *object)
/* Make a new budget; put it in a page; open the page. */
static void
gnc_plugin_budget_cmd_new_budget (GtkAction *action,
GncMainWindowActionData *user_data)
gnc_plugin_budget_cmd_new_budget (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
GncMainWindowActionData *data = user_data;
GncBudget *budget;
GncPluginPage *page;
gchar *description, *date;
QofBook *book = gnc_get_current_book();
g_return_if_fail (user_data != NULL);
g_return_if_fail (data != NULL);
if (!gnc_features_check_used (book, GNC_FEATURE_BUDGET_UNREVERSED))
{
@ -212,19 +204,22 @@ GnuCash 3.8 or later.");
g_free (description);
g_free (date);
gnc_main_window_open_page (user_data->window, page);
gnc_main_window_open_page (data->window, page);
}
/* If only one budget exists, open it; otherwise user selects one to open */
static void
gnc_plugin_budget_cmd_open_budget (GtkAction *action,
GncMainWindowActionData *user_data)
gnc_plugin_budget_cmd_open_budget (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
GncMainWindowActionData *data = user_data;
guint count;
QofBook *book;
GncBudget *bgt = NULL;
QofCollection *col;
g_return_if_fail (user_data != NULL);
g_return_if_fail (data != NULL);
book = gnc_get_current_book ();
col = qof_book_get_collection (book, GNC_ID_BUDGET);
@ -234,26 +229,29 @@ gnc_plugin_budget_cmd_open_budget (GtkAction *action,
if (count == 1)
bgt = gnc_budget_get_default (book);
else
bgt = gnc_budget_gui_select_budget (GTK_WINDOW(user_data->window), book);
bgt = gnc_budget_gui_select_budget (GTK_WINDOW(data->window), book);
if (bgt)
gnc_main_window_open_page (user_data->window,
gnc_main_window_open_page (data->window,
gnc_plugin_page_budget_new (bgt));
}
else /* if no budgets exist yet, just open a new budget */
gnc_plugin_budget_cmd_new_budget (action, user_data);
gnc_plugin_budget_cmd_new_budget (simple, parameter, user_data);
}
/* If only one budget exists, create a copy of it; otherwise user selects one to copy */
static void
gnc_plugin_budget_cmd_copy_budget (GtkAction *action,
GncMainWindowActionData *user_data)
gnc_plugin_budget_cmd_copy_budget (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
GncMainWindowActionData *data = user_data;
guint count;
QofBook *book;
GncBudget *bgt = NULL;
QofCollection *col;
g_return_if_fail (user_data != NULL);
g_return_if_fail (data != NULL);
book = gnc_get_current_book ();
col = qof_book_get_collection (book, GNC_ID_BUDGET);
@ -263,7 +261,7 @@ gnc_plugin_budget_cmd_copy_budget (GtkAction *action,
if (count == 1)
bgt = gnc_budget_get_default(book);
else
bgt = gnc_budget_gui_select_budget (GTK_WINDOW(user_data->window), book);
bgt = gnc_budget_gui_select_budget (GTK_WINDOW(data->window), book);
if (bgt)
{
@ -275,29 +273,31 @@ gnc_plugin_budget_cmd_copy_budget (GtkAction *action,
gnc_budget_set_name (copy, name);
g_free (name);
gnc_main_window_open_page (user_data->window,
gnc_main_window_open_page (data->window,
gnc_plugin_page_budget_new (copy));
}
}
else /* if no budgets exist yet, just open a new budget */
gnc_plugin_budget_cmd_new_budget (action, user_data);
gnc_plugin_budget_cmd_new_budget (simple, parameter, user_data);
}
/* user selects budget to delete */
static void
gnc_plugin_budget_cmd_delete_budget (GtkAction *action,
GncMainWindowActionData *user_data)
gnc_plugin_budget_cmd_delete_budget (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
GncMainWindowActionData *data = user_data;
GncBudget *bgt;
QofBook *book;
g_return_if_fail (user_data != NULL);
g_return_if_fail (data != NULL);
book = gnc_get_current_book ();
if (qof_collection_count (qof_book_get_collection (book, GNC_ID_BUDGET)) == 0)
return;
bgt = gnc_budget_gui_select_budget (GTK_WINDOW(user_data->window), book);
bgt = gnc_budget_gui_select_budget (GTK_WINDOW(data->window), book);
if (!bgt) return;
gnc_budget_gui_delete_budget (bgt);

View File

@ -52,6 +52,8 @@
#include "gnc-prefs.h"
#include "gnc-main-window.h"
#include "gnc-window.h"
#include "gnc-gtk-utils.h"
#include "gnc-plugin-page-register.h"
@ -63,80 +65,51 @@ static void gnc_plugin_business_class_init (GncPluginBusinessClass *klass);
static void gnc_plugin_business_init (GncPluginBusiness *plugin);
static void gnc_plugin_business_finalize (GObject *object);
static void gnc_plugin_business_add_to_window (GncPlugin *plugin,
GncMainWindow *window,
GQuark type);
GncMainWindow *window,
GQuark type);
/* Command callbacks */
static void gnc_plugin_business_cmd_customer_page (GtkAction *action,
GncMainWindowActionData *data);
static void gnc_plugin_business_cmd_customer_new_customer (GtkAction *action,
GncMainWindowActionData *data);
static void gnc_plugin_business_cmd_customer_find_customer (GtkAction *action,
GncMainWindowActionData *data);
static void gnc_plugin_business_cmd_customer_new_invoice (GtkAction *action,
GncMainWindowActionData *data);
static void gnc_plugin_business_cmd_customer_find_invoice (GtkAction *action,
GncMainWindowActionData *data);
static void gnc_plugin_business_cmd_customer_new_job (GtkAction *action,
GncMainWindowActionData *data);
static void gnc_plugin_business_cmd_customer_find_job (GtkAction *action,
GncMainWindowActionData *data);
static void gnc_plugin_business_cmd_customer_process_payment (GtkAction *action,
GncMainWindowActionData *data);
static void gnc_plugin_business_cmd_customer_page (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
static void gnc_plugin_business_cmd_customer_new_customer (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
static void gnc_plugin_business_cmd_customer_find_customer (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
static void gnc_plugin_business_cmd_customer_new_invoice (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
static void gnc_plugin_business_cmd_customer_find_invoice (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
static void gnc_plugin_business_cmd_customer_new_job (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
static void gnc_plugin_business_cmd_customer_find_job (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
static void gnc_plugin_business_cmd_customer_process_payment (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
static void gnc_plugin_business_cmd_vendor_page (GtkAction *action,
GncMainWindowActionData *data);
static void gnc_plugin_business_cmd_vendor_new_vendor (GtkAction *action,
GncMainWindowActionData *data);
static void gnc_plugin_business_cmd_vendor_find_vendor (GtkAction *action,
GncMainWindowActionData *data);
static void gnc_plugin_business_cmd_vendor_new_bill (GtkAction *action,
GncMainWindowActionData *data);
static void gnc_plugin_business_cmd_vendor_find_bill (GtkAction *action,
GncMainWindowActionData *data);
static void gnc_plugin_business_cmd_vendor_new_job (GtkAction *action,
GncMainWindowActionData *data);
static void gnc_plugin_business_cmd_vendor_find_job (GtkAction *action,
GncMainWindowActionData *data);
static void gnc_plugin_business_cmd_vendor_process_payment (GtkAction *action,
GncMainWindowActionData *data);
static void gnc_plugin_business_cmd_vendor_page (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
static void gnc_plugin_business_cmd_vendor_new_vendor (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
static void gnc_plugin_business_cmd_vendor_find_vendor (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
static void gnc_plugin_business_cmd_vendor_new_bill (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
static void gnc_plugin_business_cmd_vendor_find_bill (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
static void gnc_plugin_business_cmd_vendor_new_job (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
static void gnc_plugin_business_cmd_vendor_find_job (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
static void gnc_plugin_business_cmd_vendor_process_payment (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
static void gnc_plugin_business_cmd_employee_page (GtkAction *action,
GncMainWindowActionData *data);
static void gnc_plugin_business_cmd_employee_new_employee (GtkAction *action,
GncMainWindowActionData *data);
static void gnc_plugin_business_cmd_employee_find_employee (GtkAction *action,
GncMainWindowActionData *data);
static void gnc_plugin_business_cmd_employee_new_expense_voucher (GtkAction *action,
GncMainWindowActionData *data);
static void gnc_plugin_business_cmd_employee_find_expense_voucher (GtkAction *action,
GncMainWindowActionData *data);
static void gnc_plugin_business_cmd_employee_process_payment (GtkAction *action,
GncMainWindowActionData *data);
static void gnc_plugin_business_cmd_employee_page (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
static void gnc_plugin_business_cmd_employee_new_employee (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
static void gnc_plugin_business_cmd_employee_find_employee (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
static void gnc_plugin_business_cmd_employee_new_expense_voucher (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
static void gnc_plugin_business_cmd_employee_find_expense_voucher (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
static void gnc_plugin_business_cmd_employee_process_payment (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
static void gnc_plugin_business_cmd_doclink (GtkAction *action,
GncMainWindowActionData *data);
static void gnc_plugin_business_cmd_tax_tables (GtkAction *action,
GncMainWindowActionData *data);
static void gnc_plugin_business_cmd_billing_terms (GtkAction *action,
GncMainWindowActionData *data);
static void gnc_plugin_business_cmd_bills_due_reminder (GtkAction *action,
GncMainWindowActionData *data);
static void gnc_plugin_business_cmd_invoices_due_reminder (GtkAction *action,
GncMainWindowActionData *data);
static void gnc_plugin_business_cmd_doclink (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
static void gnc_plugin_business_cmd_tax_tables (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
static void gnc_plugin_business_cmd_billing_terms (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
static void gnc_plugin_business_cmd_bills_due_reminder (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
static void gnc_plugin_business_cmd_invoices_due_reminder (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
static void gnc_plugin_business_cmd_test_search (GtkAction *action,
GncMainWindowActionData *data);
static void gnc_plugin_business_cmd_test_search (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
static void gnc_plugin_business_cmd_test_init_data (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
static void gnc_plugin_business_cmd_test_init_data (GtkAction *action,
GncMainWindowActionData *data);
static void gnc_plugin_business_cmd_assign_payment (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
static void gnc_plugin_business_cmd_assign_payment (GtkAction *action,
GncMainWindowActionData *data);
static void update_inactive_actions(GncPluginPage *page);
static void update_inactive_actions (GncPluginPage *page);
static void bind_extra_toolbuttons_visibility (GncMainWindow *mainwindow);
#define PLUGIN_ACTIONS_NAME "gnc-plugin-business-actions"
#define PLUGIN_UI_FILENAME "gnc-plugin-business-ui.xml"
#define PLUGIN_UI_FILENAME "gnc-plugin-business.ui"
#define GNC_PREF_EXTRA_TOOLBUTTONS "enable-toolbuttons"
#define GNC_PREF_INV_PRINT_RPT "invoice-printreport"
@ -149,192 +122,56 @@ static void update_inactive_actions(GncPluginPage *page);
*/
static GncMainWindow *last_window = NULL;
static GtkActionEntry gnc_plugin_actions [] =
static GActionEntry gnc_plugin_actions [] =
{
/* Toplevel */
{ "BusinessAction", NULL, N_("_Business"), NULL, NULL, NULL },
{ "CustomerOverviewPageAction", gnc_plugin_business_cmd_customer_page, NULL, NULL, NULL },
{ "CustomerNewCustomerOpenAction", gnc_plugin_business_cmd_customer_new_customer, NULL, NULL, NULL },
{ "CustomerFindCustomerOpenAction", gnc_plugin_business_cmd_customer_find_customer, NULL, NULL, NULL },
{ "CustomerNewInvoiceOpenAction", gnc_plugin_business_cmd_customer_new_invoice, NULL, NULL, NULL },
{ "CustomerFindInvoiceOpenAction", gnc_plugin_business_cmd_customer_find_invoice, NULL, NULL, NULL },
{ "CustomerNewJobOpenAction", gnc_plugin_business_cmd_customer_new_job, NULL, NULL, NULL },
{ "CustomerFindJobOpenAction", gnc_plugin_business_cmd_customer_find_job, NULL, NULL, NULL },
{ "CustomerProcessPaymentAction", gnc_plugin_business_cmd_customer_process_payment, NULL, NULL, NULL },
/* Customer submenu */
{ "CustomerMenuAction", NULL, N_("_Customer"), NULL, NULL, NULL },
{
"CustomerOverviewPageAction", NULL, N_("Customers Overview"), NULL,
N_("Open a Customer overview page"),
G_CALLBACK (gnc_plugin_business_cmd_customer_page)
},
{
"CustomerNewCustomerOpenAction", NULL, N_("_New Customer…"), NULL,
N_("Open the New Customer dialog"),
G_CALLBACK (gnc_plugin_business_cmd_customer_new_customer)
},
{
"CustomerFindCustomerOpenAction", NULL, N_("_Find Customer…"), NULL,
N_("Open the Find Customer dialog"),
G_CALLBACK (gnc_plugin_business_cmd_customer_find_customer)
},
{
"CustomerNewInvoiceOpenAction", NULL, N_("New _Invoice…"), NULL,
N_("Open the New Invoice dialog"),
G_CALLBACK (gnc_plugin_business_cmd_customer_new_invoice)
},
{
"CustomerFindInvoiceOpenAction", NULL, N_("Find In_voice…"), NULL,
N_("Open the Find Invoice dialog"),
G_CALLBACK (gnc_plugin_business_cmd_customer_find_invoice)
},
{
"CustomerNewJobOpenAction", NULL, N_("New _Job…"), NULL,
N_("Open the New Job dialog"),
G_CALLBACK (gnc_plugin_business_cmd_customer_new_job)
},
{
"CustomerFindJobOpenAction", NULL, N_("Find Jo_b…"), NULL,
N_("Open the Find Job dialog"),
G_CALLBACK (gnc_plugin_business_cmd_customer_find_job)
},
{
"CustomerProcessPaymentAction", NULL, N_("_Process Payment…"), NULL,
N_("Open the Process Payment dialog"),
G_CALLBACK (gnc_plugin_business_cmd_customer_process_payment)
},
{ "VendorOverviewPageAction", gnc_plugin_business_cmd_vendor_page, NULL, NULL, NULL },
{ "VendorNewVendorOpenAction", gnc_plugin_business_cmd_vendor_new_vendor, NULL, NULL, NULL },
{ "VendorFindVendorOpenAction", gnc_plugin_business_cmd_vendor_find_vendor, NULL, NULL, NULL },
{ "VendorNewBillOpenAction", gnc_plugin_business_cmd_vendor_new_bill, NULL, NULL, NULL },
{ "VendorFindBillOpenAction", gnc_plugin_business_cmd_vendor_find_bill, NULL, NULL, NULL },
{ "VendorNewJobOpenAction", gnc_plugin_business_cmd_vendor_new_job, NULL, NULL, NULL },
{ "VendorFindJobOpenAction", gnc_plugin_business_cmd_vendor_find_job, NULL, NULL, NULL },
{ "VendorProcessPaymentAction", gnc_plugin_business_cmd_vendor_process_payment, NULL, NULL, NULL },
/* Vendor submenu */
{
"VendorOverviewPageAction", NULL, N_("Vendors Overview"), NULL,
N_("Open a Vendor overview page"),
G_CALLBACK (gnc_plugin_business_cmd_vendor_page)
},
{ "VendorMenuAction", NULL, N_("_Vendor"), NULL, NULL, NULL },
{
"VendorNewVendorOpenAction", NULL, N_("_New Vendor…"), NULL,
N_("Open the New Vendor dialog"),
G_CALLBACK (gnc_plugin_business_cmd_vendor_new_vendor)
},
{
"VendorFindVendorOpenAction", NULL, N_("_Find Vendor…"), NULL,
N_("Open the Find Vendor dialog"),
G_CALLBACK (gnc_plugin_business_cmd_vendor_find_vendor)
},
{
"VendorNewBillOpenAction", NULL, N_("New _Bill…"), NULL,
N_("Open the New Bill dialog"),
G_CALLBACK (gnc_plugin_business_cmd_vendor_new_bill)
},
{
"VendorFindBillOpenAction", NULL, N_("Find Bi_ll…"), NULL,
N_("Open the Find Bill dialog"),
G_CALLBACK (gnc_plugin_business_cmd_vendor_find_bill)
},
{
"VendorNewJobOpenAction", NULL, N_("New _Job…"), NULL,
N_("Open the New Job dialog"),
G_CALLBACK (gnc_plugin_business_cmd_vendor_new_job)
},
{
"VendorFindJobOpenAction", NULL, N_("Find Jo_b…"), NULL,
N_("Open the Find Job dialog"),
G_CALLBACK (gnc_plugin_business_cmd_vendor_find_job)
},
{
"VendorProcessPaymentAction", NULL, N_("_Process Payment…"), NULL,
N_("Open the Process Payment dialog"),
G_CALLBACK (gnc_plugin_business_cmd_vendor_process_payment)
},
{ "EmployeeOverviewPageAction", gnc_plugin_business_cmd_employee_page, NULL, NULL, NULL },
{ "EmployeeNewEmployeeOpenAction", gnc_plugin_business_cmd_employee_new_employee, NULL, NULL, NULL },
{ "EmployeeFindEmployeeOpenAction", gnc_plugin_business_cmd_employee_find_employee, NULL, NULL, NULL },
{ "EmployeeNewExpenseVoucherOpenAction", gnc_plugin_business_cmd_employee_new_expense_voucher, NULL, NULL, NULL },
{ "EmployeeFindExpenseVoucherOpenAction", gnc_plugin_business_cmd_employee_find_expense_voucher, NULL, NULL, NULL },
{ "EmployeeProcessPaymentAction", gnc_plugin_business_cmd_employee_process_payment, NULL, NULL, NULL },
/* Employee submenu */
{
"EmployeeOverviewPageAction", NULL, N_("Employees Overview"), NULL,
N_("Open a Employee overview page"),
G_CALLBACK (gnc_plugin_business_cmd_employee_page)
},
{ "EmployeeMenuAction", NULL, N_("_Employee"), NULL, NULL, NULL },
{
"EmployeeNewEmployeeOpenAction", NULL, N_("_New Employee…"), NULL,
N_("Open the New Employee dialog"),
G_CALLBACK (gnc_plugin_business_cmd_employee_new_employee)
},
{
"EmployeeFindEmployeeOpenAction", NULL, N_("_Find Employee…"), NULL,
N_("Open the Find Employee dialog"),
G_CALLBACK (gnc_plugin_business_cmd_employee_find_employee)
},
{
"EmployeeNewExpenseVoucherOpenAction", NULL, N_("New _Expense Voucher…"), NULL,
N_("Open the New Expense Voucher dialog"),
G_CALLBACK (gnc_plugin_business_cmd_employee_new_expense_voucher)
},
{
"EmployeeFindExpenseVoucherOpenAction", NULL, N_("Find Expense _Voucher…"), NULL,
N_("Open the Find Expense Voucher dialog"),
G_CALLBACK (gnc_plugin_business_cmd_employee_find_expense_voucher)
},
{
"EmployeeProcessPaymentAction", NULL, N_("_Process Payment…"), NULL,
N_("Open the Process Payment dialog"),
G_CALLBACK (gnc_plugin_business_cmd_employee_process_payment)
},
{ "BusinessLinkedDocsAction", gnc_plugin_business_cmd_doclink, NULL, NULL, NULL },
{ "TaxTablesOpenAction", gnc_plugin_business_cmd_tax_tables, NULL, NULL, NULL },
{ "BillingTermsOpenAction", gnc_plugin_business_cmd_billing_terms, NULL, NULL, NULL },
{ "BillsDueReminderOpenAction", gnc_plugin_business_cmd_bills_due_reminder, NULL, NULL, NULL },
{ "InvoicesDueReminderOpenAction", gnc_plugin_business_cmd_invoices_due_reminder, NULL, NULL, NULL },
/* Other menu items */
{
"BusinessLinkedDocsAction", NULL, N_("Business Linked Documents"), NULL,
N_("View all Linked Business Documents"),
G_CALLBACK (gnc_plugin_business_cmd_doclink)
},
{
"TaxTablesOpenAction", NULL, N_("Sales _Tax Table"), NULL,
N_("View and edit the list of Sales Tax Tables (GST/VAT)"),
G_CALLBACK (gnc_plugin_business_cmd_tax_tables)
},
{
"BillingTermsOpenAction", NULL, N_("_Billing Terms Editor"), NULL,
N_("View and edit the list of Billing Terms"),
G_CALLBACK (gnc_plugin_business_cmd_billing_terms)
},
{
"BillsDueReminderOpenAction", NULL, N_("Bills _Due Reminder"), NULL,
N_("Open the Bills Due Reminder dialog"),
G_CALLBACK (gnc_plugin_business_cmd_bills_due_reminder)
},
{
"InvoicesDueReminderOpenAction", NULL, N_("Invoices _Due Reminder"), NULL,
N_("Open the Invoices Due Reminder dialog"),
G_CALLBACK (gnc_plugin_business_cmd_invoices_due_reminder)
},
{ "ExportMenuAction", NULL, N_("E_xport"), NULL, NULL, NULL },
/* Extensions Menu */
{ "BusinessTestAction", NULL, N_("_Business"), NULL, NULL, NULL },
{
"BusinessTestSearchAction", NULL, N_("Test Search Dialog"), NULL,
N_("Test Search Dialog"),
G_CALLBACK (gnc_plugin_business_cmd_test_search)
},
{
"BusinessTestInitDataAction", NULL, N_("Initialize Test Data"), NULL,
N_("Initialize Test Data"),
G_CALLBACK (gnc_plugin_business_cmd_test_init_data)
},
/* Toolbar */
{
"ToolbarNewInvoiceAction", GNC_ICON_INVOICE_NEW, N_("New _Invoice…"), NULL,
N_("Open the New Invoice dialog"),
G_CALLBACK (gnc_plugin_business_cmd_customer_new_invoice)
},
/* Register popup menu */
{
"RegisterAssignPayment", NULL, N_("Assign as payment…"), NULL,
N_("Assign the selected transaction as payment"),
G_CALLBACK (gnc_plugin_business_cmd_assign_payment)
},
{
"RegisterEditPayment", NULL, N_("Edit payment…"), NULL,
N_("Edit the payment this transaction is a part of"),
G_CALLBACK (gnc_plugin_business_cmd_assign_payment)
},
{ "BusinessTestSearchAction", gnc_plugin_business_cmd_test_search, NULL, NULL, NULL },
{ "BusinessTestInitDataAction", gnc_plugin_business_cmd_test_init_data, NULL, NULL, NULL },
{ "ToolbarNewInvoiceAction", gnc_plugin_business_cmd_customer_new_invoice, NULL, NULL, NULL },
{ "RegisterAssignPayment", gnc_plugin_business_cmd_assign_payment, NULL, NULL, NULL },
{ "RegisterEditPayment", gnc_plugin_business_cmd_assign_payment, NULL, NULL, NULL },
};
static guint gnc_plugin_n_actions = G_N_ELEMENTS (gnc_plugin_actions);
/** The number of actions provided by this plugin. */
static guint gnc_plugin_n_actions = G_N_ELEMENTS(gnc_plugin_actions);
/** The default menu items that need to be add to the menu */
static const gchar *gnc_plugin_load_ui_items [] =
{
"BusinessPlaceholder0",
"BusinessPlaceholder1",
"ExtensionsPlaceholder0",
NULL,
};
/************************************************************
* Plugin Function Implementation *
@ -387,10 +224,11 @@ gnc_plugin_business_class_init (GncPluginBusinessClass *klass)
plugin_class->add_to_window = gnc_plugin_business_add_to_window;
/* widget addition/removal */
plugin_class->actions_name = PLUGIN_ACTIONS_NAME;
plugin_class->actions = gnc_plugin_actions;
plugin_class->n_actions = gnc_plugin_n_actions;
plugin_class->ui_filename = PLUGIN_UI_FILENAME;
plugin_class->actions_name = PLUGIN_ACTIONS_NAME;
plugin_class->actions = gnc_plugin_actions;
plugin_class->n_actions = gnc_plugin_n_actions;
plugin_class->ui_filename = PLUGIN_UI_FILENAME;
plugin_class->ui_updates = gnc_plugin_load_ui_items;
}
static void
@ -432,9 +270,11 @@ gnc_plugin_business_get_window()
************************************************************/
static void
gnc_plugin_business_cmd_customer_page (GtkAction *action,
GncMainWindowActionData *mw)
gnc_plugin_business_cmd_customer_page (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
GncMainWindowActionData *mw = user_data;
GncPluginPage *page;
g_return_if_fail (mw != NULL);
@ -445,9 +285,12 @@ gnc_plugin_business_cmd_customer_page (GtkAction *action,
}
static void
gnc_plugin_business_cmd_customer_new_customer (GtkAction *action,
GncMainWindowActionData *mw)
gnc_plugin_business_cmd_customer_new_customer (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
GncMainWindowActionData *mw = user_data;
g_return_if_fail (mw != NULL);
g_return_if_fail (GNC_IS_PLUGIN_BUSINESS (mw->data));
@ -455,9 +298,11 @@ gnc_plugin_business_cmd_customer_new_customer (GtkAction *action,
}
static void
gnc_plugin_business_cmd_customer_find_customer (GtkAction *action,
GncMainWindowActionData *mw)
gnc_plugin_business_cmd_customer_find_customer (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
GncMainWindowActionData *mw = user_data;
GncPluginBusiness *plugin;
GncPluginBusinessPrivate *priv;
GncCustomer*customer;
@ -472,9 +317,11 @@ gnc_plugin_business_cmd_customer_find_customer (GtkAction *action,
}
static void
gnc_plugin_business_cmd_customer_new_invoice (GtkAction *action,
GncMainWindowActionData *mw)
gnc_plugin_business_cmd_customer_new_invoice (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
GncMainWindowActionData *mw = user_data;
GncPluginBusiness *plugin;
GncPluginBusinessPrivate *priv;
@ -488,9 +335,11 @@ gnc_plugin_business_cmd_customer_new_invoice (GtkAction *action,
}
static void
gnc_plugin_business_cmd_customer_find_invoice (GtkAction *action,
GncMainWindowActionData *mw)
gnc_plugin_business_cmd_customer_find_invoice (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
GncMainWindowActionData *mw = user_data;
GncPluginBusiness *plugin;
GncPluginBusinessPrivate *priv;
@ -504,9 +353,11 @@ gnc_plugin_business_cmd_customer_find_invoice (GtkAction *action,
}
static void
gnc_plugin_business_cmd_customer_new_job (GtkAction *action,
GncMainWindowActionData *mw)
gnc_plugin_business_cmd_customer_new_job (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
GncMainWindowActionData *mw = user_data;
GncPluginBusiness *plugin;
GncPluginBusinessPrivate *priv;
@ -519,9 +370,11 @@ gnc_plugin_business_cmd_customer_new_job (GtkAction *action,
}
static void
gnc_plugin_business_cmd_customer_find_job (GtkAction *action,
GncMainWindowActionData *mw)
gnc_plugin_business_cmd_customer_find_job (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
GncMainWindowActionData *mw = user_data;
GncPluginBusiness *plugin;
GncPluginBusinessPrivate *priv;
@ -534,9 +387,11 @@ gnc_plugin_business_cmd_customer_find_job (GtkAction *action,
}
static void
gnc_plugin_business_cmd_customer_process_payment (GtkAction *action,
GncMainWindowActionData *mw)
gnc_plugin_business_cmd_customer_process_payment (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
GncMainWindowActionData *mw = user_data;
GncPluginBusiness *plugin;
GncPluginBusinessPrivate *priv;
@ -549,9 +404,11 @@ gnc_plugin_business_cmd_customer_process_payment (GtkAction *action,
}
static void
gnc_plugin_business_cmd_vendor_page (GtkAction *action,
GncMainWindowActionData *mw)
gnc_plugin_business_cmd_vendor_page (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
GncMainWindowActionData *mw = user_data;
GncPluginPage *page;
g_return_if_fail (mw != NULL);
@ -562,9 +419,11 @@ gnc_plugin_business_cmd_vendor_page (GtkAction *action,
}
static void
gnc_plugin_business_cmd_vendor_new_vendor (GtkAction *action,
GncMainWindowActionData *mw)
gnc_plugin_business_cmd_vendor_new_vendor (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
GncMainWindowActionData *mw = user_data;
g_return_if_fail (mw != NULL);
g_return_if_fail (GNC_IS_PLUGIN_BUSINESS (mw->data));
@ -572,9 +431,11 @@ gnc_plugin_business_cmd_vendor_new_vendor (GtkAction *action,
}
static void
gnc_plugin_business_cmd_vendor_find_vendor (GtkAction *action,
GncMainWindowActionData *mw)
gnc_plugin_business_cmd_vendor_find_vendor (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
GncMainWindowActionData *mw = user_data;
GncPluginBusiness *plugin;
GncPluginBusinessPrivate *priv;
GncVendor *vendor;
@ -589,9 +450,11 @@ gnc_plugin_business_cmd_vendor_find_vendor (GtkAction *action,
}
static void
gnc_plugin_business_cmd_vendor_new_bill (GtkAction *action,
GncMainWindowActionData *mw)
gnc_plugin_business_cmd_vendor_new_bill (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
GncMainWindowActionData *mw = user_data;
GncPluginBusiness *plugin;
GncPluginBusinessPrivate *priv;
@ -605,9 +468,11 @@ gnc_plugin_business_cmd_vendor_new_bill (GtkAction *action,
}
static void
gnc_plugin_business_cmd_vendor_find_bill (GtkAction *action,
GncMainWindowActionData *mw)
gnc_plugin_business_cmd_vendor_find_bill (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
GncMainWindowActionData *mw = user_data;
GncPluginBusiness *plugin;
GncPluginBusinessPrivate *priv;
@ -621,9 +486,11 @@ gnc_plugin_business_cmd_vendor_find_bill (GtkAction *action,
}
static void
gnc_plugin_business_cmd_vendor_new_job (GtkAction *action,
GncMainWindowActionData *mw)
gnc_plugin_business_cmd_vendor_new_job (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
GncMainWindowActionData *mw = user_data;
GncPluginBusiness *plugin;
GncPluginBusinessPrivate *priv;
@ -636,9 +503,11 @@ gnc_plugin_business_cmd_vendor_new_job (GtkAction *action,
}
static void
gnc_plugin_business_cmd_vendor_find_job (GtkAction *action,
GncMainWindowActionData *mw)
gnc_plugin_business_cmd_vendor_find_job (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
GncMainWindowActionData *mw = user_data;
GncPluginBusiness *plugin;
GncPluginBusinessPrivate *priv;
@ -651,9 +520,11 @@ gnc_plugin_business_cmd_vendor_find_job (GtkAction *action,
}
static void
gnc_plugin_business_cmd_vendor_process_payment (GtkAction *action,
GncMainWindowActionData *mw)
gnc_plugin_business_cmd_vendor_process_payment (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
GncMainWindowActionData *mw = user_data;
GncPluginBusiness *plugin;
GncPluginBusinessPrivate *priv;
@ -666,9 +537,11 @@ gnc_plugin_business_cmd_vendor_process_payment (GtkAction *action,
}
static void
gnc_plugin_business_cmd_employee_page (GtkAction *action,
GncMainWindowActionData *mw)
gnc_plugin_business_cmd_employee_page (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
GncMainWindowActionData *mw = user_data;
GncPluginPage *page;
g_return_if_fail (mw != NULL);
@ -679,9 +552,11 @@ gnc_plugin_business_cmd_employee_page (GtkAction *action,
}
static void
gnc_plugin_business_cmd_employee_new_employee (GtkAction *action,
GncMainWindowActionData *mw)
gnc_plugin_business_cmd_employee_new_employee (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
GncMainWindowActionData *mw = user_data;
g_return_if_fail (mw != NULL);
g_return_if_fail (GNC_IS_PLUGIN_BUSINESS (mw->data));
@ -689,9 +564,11 @@ gnc_plugin_business_cmd_employee_new_employee (GtkAction *action,
}
static void
gnc_plugin_business_cmd_employee_find_employee (GtkAction *action,
GncMainWindowActionData *mw)
gnc_plugin_business_cmd_employee_find_employee (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
GncMainWindowActionData *mw = user_data;
GncPluginBusiness *plugin;
GncPluginBusinessPrivate *priv;
GncEmployee *employee;
@ -706,9 +583,11 @@ gnc_plugin_business_cmd_employee_find_employee (GtkAction *action,
}
static void
gnc_plugin_business_cmd_employee_new_expense_voucher (GtkAction *action,
GncMainWindowActionData *mw)
gnc_plugin_business_cmd_employee_new_expense_voucher (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
GncMainWindowActionData *mw = user_data;
GncPluginBusiness *plugin;
GncPluginBusinessPrivate *priv;
@ -722,9 +601,11 @@ gnc_plugin_business_cmd_employee_new_expense_voucher (GtkAction *action,
}
static void
gnc_plugin_business_cmd_employee_find_expense_voucher (GtkAction *action,
GncMainWindowActionData *mw)
gnc_plugin_business_cmd_employee_find_expense_voucher (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
GncMainWindowActionData *mw = user_data;
GncPluginBusiness *plugin;
GncPluginBusinessPrivate *priv;
@ -738,9 +619,11 @@ gnc_plugin_business_cmd_employee_find_expense_voucher (GtkAction *action,
}
static void
gnc_plugin_business_cmd_employee_process_payment (GtkAction *action,
GncMainWindowActionData *mw)
gnc_plugin_business_cmd_employee_process_payment (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
GncMainWindowActionData *mw = user_data;
GncPluginBusiness *plugin;
GncPluginBusinessPrivate *priv;
@ -753,9 +636,11 @@ gnc_plugin_business_cmd_employee_process_payment (GtkAction *action,
}
static void
gnc_plugin_business_cmd_doclink (GtkAction *action,
GncMainWindowActionData *mw)
gnc_plugin_business_cmd_doclink (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
GncMainWindowActionData *mw = user_data;
g_return_if_fail (mw != NULL);
g_return_if_fail (GNC_IS_PLUGIN_BUSINESS (mw->data));
@ -763,9 +648,11 @@ gnc_plugin_business_cmd_doclink (GtkAction *action,
}
static void
gnc_plugin_business_cmd_tax_tables (GtkAction *action,
GncMainWindowActionData *mw)
gnc_plugin_business_cmd_tax_tables (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
GncMainWindowActionData *mw = user_data;
g_return_if_fail (mw != NULL);
g_return_if_fail (GNC_IS_PLUGIN_BUSINESS (mw->data));
@ -773,9 +660,11 @@ gnc_plugin_business_cmd_tax_tables (GtkAction *action,
}
static void
gnc_plugin_business_cmd_billing_terms (GtkAction *action,
GncMainWindowActionData *mw)
gnc_plugin_business_cmd_billing_terms (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
GncMainWindowActionData *mw = user_data;
g_return_if_fail (mw != NULL);
g_return_if_fail (GNC_IS_PLUGIN_BUSINESS (mw->data));
@ -784,9 +673,11 @@ gnc_plugin_business_cmd_billing_terms (GtkAction *action,
static void
gnc_plugin_business_cmd_bills_due_reminder (GtkAction *action,
GncMainWindowActionData *mw)
gnc_plugin_business_cmd_bills_due_reminder (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
GncMainWindowActionData *mw = user_data;
g_return_if_fail (mw != NULL);
g_return_if_fail (GNC_IS_PLUGIN_BUSINESS (mw->data));
@ -795,9 +686,11 @@ gnc_plugin_business_cmd_bills_due_reminder (GtkAction *action,
static void
gnc_plugin_business_cmd_invoices_due_reminder (GtkAction *action,
GncMainWindowActionData *mw)
gnc_plugin_business_cmd_invoices_due_reminder (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
GncMainWindowActionData *mw = user_data;
g_return_if_fail (mw != NULL);
g_return_if_fail (GNC_IS_PLUGIN_BUSINESS (mw->data));
@ -805,15 +698,18 @@ gnc_plugin_business_cmd_invoices_due_reminder (GtkAction *action,
}
static void
gnc_plugin_business_cmd_test_search (GtkAction *action,
GncMainWindowActionData *data)
gnc_plugin_business_cmd_test_search (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
GncMainWindowActionData *mw = user_data;
gnc_search_dialog_test();
}
static void gnc_business_assign_payment (GtkWindow *parent,
Transaction *trans,
GncOwner *owner)
static void
gnc_business_assign_payment (GtkWindow *parent,
Transaction *trans,
GncOwner *owner)
{
g_return_if_fail(trans);
@ -825,9 +721,12 @@ static void gnc_business_assign_payment (GtkWindow *parent,
gnc_ui_payment_new_with_txn(parent, owner, trans);
}
static void gnc_plugin_business_cmd_assign_payment (GtkAction *action,
GncMainWindowActionData *mw)
static void
gnc_plugin_business_cmd_assign_payment (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
GncMainWindowActionData *mw = user_data;
GncPluginBusiness *plugin_business;
GncPluginBusinessPrivate *plugin_business_priv;
GncPluginPage *plugin_page;
@ -892,8 +791,7 @@ static const gchar *register_bus_txn_actions[] =
static void
gnc_plugin_business_update_menus (GncPluginPage *plugin_page)
{
GncMainWindow *window;
GtkActionGroup *action_group;
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
@ -904,11 +802,14 @@ gnc_plugin_business_update_menus (GncPluginPage *plugin_page)
if (!GNC_IS_MAIN_WINDOW(plugin_page->window))
return;
// We are readonly - we have already set particular actions to inactive.
if (qof_book_is_readonly (gnc_get_current_book()))
return;
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 (GNC_MAIN_WINDOW(plugin_page->window),
PLUGIN_ACTIONS_NAME);
g_return_if_fail (G_IS_SIMPLE_ACTION_GROUP(simple_action_group));
if (is_txn_register)
{
@ -918,35 +819,48 @@ 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,
"sensitive", is_txn_register && !is_bus_txn && !is_bus_doc);
gnc_plugin_update_actions (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,
"sensitive", is_txn_register && is_bus_txn && !is_bus_doc);
gnc_plugin_update_actions (action_group, register_bus_txn_actions,
"visible", is_txn_register && is_bus_txn && !is_bus_doc);
gnc_plugin_set_actions_enabled (G_ACTION_MAP(simple_action_group), register_txn_actions,
is_txn_register && !is_bus_txn && !is_bus_doc);
gnc_plugin_set_actions_enabled (G_ACTION_MAP(simple_action_group), register_bus_txn_actions,
is_txn_register && is_bus_txn && !is_bus_doc);
}
static void gnc_plugin_business_main_window_page_changed(GncMainWindow *window,
GncPluginPage *page,
gpointer user_data)
static void
gnc_plugin_business_main_window_page_changed (GncMainWindow *window,
GncPluginPage *page,
gpointer user_data)
{
gnc_plugin_business_update_menus(page);
update_inactive_actions(page);
gnc_plugin_business_update_menus(page);
}
static void
gnc_plugin_business_main_window_menu_changed (GncMainWindow *window,
GncPluginPage *page,
gpointer user_data)
{
// page could be NULL when gnucash started with --nofile
if (page == gnc_main_window_get_current_page (window))
{
if (page)
gnc_plugin_business_main_window_page_changed (window, page, user_data);
bind_extra_toolbuttons_visibility (window);
}
}
void gnc_plugin_business_split_reg_ui_update (GncPluginPage *plugin_page)
void
gnc_plugin_business_split_reg_ui_update (GncPluginPage *plugin_page)
{
gnc_plugin_business_main_window_page_changed(NULL, plugin_page, NULL);
}
static void
gnc_plugin_business_cmd_test_init_data (GtkAction *action,
GncMainWindowActionData *data)
gnc_plugin_business_cmd_test_init_data (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
GncMainWindowActionData *mw = user_data;
QofBook *book = gnc_get_current_book();
GncCustomer *customer = gncCustomerCreate(book);
GncAddress *address = gncCustomerGetAddr(customer);
@ -1011,7 +925,7 @@ gnc_plugin_business_cmd_test_init_data (GtkAction *action,
gnc_account_append_child(root, tax_acct);
// Launch the invoice editor
gnc_ui_invoice_edit (GTK_WINDOW (data->window), invoice);
gnc_ui_invoice_edit (GTK_WINDOW (mw->window), invoice);
}
/* This is the list of actions which are switched inactive in a read-only book. */
@ -1035,10 +949,11 @@ static const gchar* readonly_inactive_actions[] =
NULL
};
static void update_inactive_actions(GncPluginPage *plugin_page)
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());
@ -1053,12 +968,12 @@ 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,
"sensitive", is_readwrite);
gnc_plugin_set_actions_enabled (G_ACTION_MAP(simple_action_group), readonly_inactive_actions,
is_readwrite);
}
/* This is the list of actions which are switched invisible or visible
@ -1071,24 +986,48 @@ static const char* extra_toolbar_actions[] =
/* Bind the visibility of the extra toolbar buttons to the
* enable_toolbuttons preference. */
static void bind_toolbuttons_visibility (GncMainWindow *mainwindow)
static void
bind_extra_toolbuttons_visibility (GncMainWindow *mainwindow)
{
GtkActionGroup *action_group;
GtkWidget *toolbar;
const char **iter;
g_return_if_fail(mainwindow);
g_return_if_fail(GNC_IS_MAIN_WINDOW(mainwindow));
g_return_if_fail (mainwindow);
g_return_if_fail (GNC_IS_MAIN_WINDOW(mainwindow));
/* Get the action group */
action_group =
gnc_main_window_get_action_group(mainwindow, PLUGIN_ACTIONS_NAME);
g_assert(action_group);
toolbar = gnc_window_get_toolbar (GNC_WINDOW(mainwindow));
if (!toolbar)
return;
// Set the 'extra' tool items visibility
for (iter = extra_toolbar_actions; *iter; ++iter)
{
/* Set the action's visibility */
GtkAction *action = gtk_action_group_get_action (action_group, *iter);
gnc_prefs_bind (GNC_PREFS_GROUP_INVOICE, GNC_PREF_EXTRA_TOOLBUTTONS, G_OBJECT (action), "visible");
GtkWidget *tool_item = gnc_find_toolbar_item (toolbar, *iter);
if (tool_item)
{
gnc_prefs_bind (GNC_PREFS_GROUP_INVOICE,
GNC_PREF_EXTRA_TOOLBUTTONS,
G_OBJECT(tool_item), "visible");
}
}
// Set the 'extra' tool item separator visibility
for (gint i = 0; i < gtk_toolbar_get_n_items (GTK_TOOLBAR(toolbar)); i++)
{
GtkToolItem *tool_item = gtk_toolbar_get_nth_item (GTK_TOOLBAR(toolbar), i);
if (GTK_IS_SEPARATOR_TOOL_ITEM(tool_item))
{
if (g_str_has_prefix (gtk_buildable_get_name (GTK_BUILDABLE(tool_item)),
"extra_separator"))
{
gnc_prefs_bind (GNC_PREFS_GROUP_INVOICE,
GNC_PREF_EXTRA_TOOLBUTTONS,
G_OBJECT(tool_item), "visible");
}
}
}
}
@ -1098,15 +1037,18 @@ static void bind_toolbuttons_visibility (GncMainWindow *mainwindow)
*
* Update the toolbar button visibility each time our plugin is added
* to a new GncMainWindow. */
static void gnc_plugin_business_add_to_window (GncPlugin *plugin,
GncMainWindow *mainwindow,
GQuark type)
static void
gnc_plugin_business_add_to_window (GncPlugin *plugin,
GncMainWindow *mainwindow,
GQuark type)
{
bind_toolbuttons_visibility (mainwindow);
g_signal_connect (mainwindow, "page_changed",
G_CALLBACK(gnc_plugin_business_main_window_page_changed),
plugin);
g_signal_connect(mainwindow, "page_changed",
G_CALLBACK(gnc_plugin_business_main_window_page_changed),
plugin);
g_signal_connect (mainwindow, "menu_changed",
G_CALLBACK(gnc_plugin_business_main_window_menu_changed),
plugin);
}
static const char* invoice_printreport_values[] =
@ -1123,7 +1065,8 @@ static const char* invoice_printreport_values[] =
NULL
};
const char *gnc_plugin_business_get_invoice_printreport(void)
const char *
gnc_plugin_business_get_invoice_printreport (void)
{
int value = gnc_prefs_get_int (GNC_PREFS_GROUP_INVOICE, GNC_PREF_INV_PRINT_RPT);
if (value >= 0 && value < 4)

View File

@ -47,6 +47,7 @@
#include "dialog-transfer.h"
#include "dialog-utils.h"
#include "assistant-hierarchy.h"
#include "assistant-stock-transaction.h"
#include "gnc-account-sel.h"
#include "gnc-component-manager.h"
#include "gnc-engine.h"
@ -136,44 +137,43 @@ static GncPluginPage *gnc_plugin_page_account_tree_recreate_page (GtkWidget *win
/* Callbacks */
static void gnc_plugin_page_account_tree_summarybar_position_changed(gpointer prefs, gchar* pref, gpointer user_data);
static gboolean gnc_plugin_page_account_tree_button_press_cb (GtkWidget *widget,
GdkEventButton *event,
GncPluginPage *page);
static void gnc_plugin_page_account_tree_double_click_cb (GtkTreeView *treeview,
GtkTreePath *path,
GtkTreeViewColumn *col,
GncPluginPageAccountTree *page);
static gboolean gnc_plugin_page_account_tree_button_press_cb (GtkWidget *widget, GdkEventButton *event, GncPluginPage *page);
static void gnc_plugin_page_account_tree_double_click_cb (GtkTreeView *treeview,
GtkTreePath *path,
GtkTreeViewColumn *col,
GncPluginPageAccountTree *page);
static void gnc_plugin_page_account_tree_selection_changed_cb (GtkTreeSelection *selection,
GncPluginPageAccountTree *page);
GncPluginPageAccountTree *page);
void gppat_populate_trans_mas_list(GtkToggleButton *sa_mrb, GtkWidget *dialog);
void gppat_set_insensitive_iff_rb_active(GtkWidget *widget, GtkToggleButton *b);
/* Command callbacks */
static void gnc_plugin_page_account_tree_cmd_new_account (GtkAction *action, GncPluginPageAccountTree *plugin_page);
static void gnc_plugin_page_account_tree_cmd_file_new_hierarchy (GtkAction *action, GncPluginPageAccountTree *plugin_page);
static void gnc_plugin_page_account_tree_cmd_open_account (GtkAction *action, GncPluginPageAccountTree *page);
static void gnc_plugin_page_account_tree_cmd_open_subaccounts (GtkAction *action, GncPluginPageAccountTree *page);
static void gnc_plugin_page_account_tree_cmd_edit_account (GtkAction *action, GncPluginPageAccountTree *page);
static void gnc_plugin_page_account_tree_cmd_find_account (GtkAction *action, GncPluginPageAccountTree *page);
static void gnc_plugin_page_account_tree_cmd_find_account_popup (GtkAction *action, GncPluginPageAccountTree *page);
static void gnc_plugin_page_account_tree_cmd_delete_account (GtkAction *action, GncPluginPageAccountTree *page);
static void gnc_plugin_page_account_tree_cmd_renumber_accounts (GtkAction *action, GncPluginPageAccountTree *page);
static void gnc_plugin_page_account_tree_cmd_view_filter_by (GtkAction *action, GncPluginPageAccountTree *plugin_page);
static void gnc_plugin_page_account_tree_cmd_reconcile (GtkAction *action, GncPluginPageAccountTree *page);
static void gnc_plugin_page_account_tree_cmd_refresh (GtkAction *action, GncPluginPageAccountTree *page);
static void gnc_plugin_page_account_tree_cmd_autoclear (GtkAction *action, GncPluginPageAccountTree *page);
static void gnc_plugin_page_account_tree_cmd_transfer (GtkAction *action, GncPluginPageAccountTree *page);
static void gnc_plugin_page_account_tree_cmd_stock_split (GtkAction *action, GncPluginPageAccountTree *page);
static void gnc_plugin_page_account_tree_cmd_edit_tax_options (GtkAction *action, GncPluginPageAccountTree *page);
static void gnc_plugin_page_account_tree_cmd_lots (GtkAction *action, GncPluginPageAccountTree *page);
static void gnc_plugin_page_account_tree_cmd_scrub (GtkAction *action, GncPluginPageAccountTree *page);
static void gnc_plugin_page_account_tree_cmd_scrub_sub (GtkAction *action, GncPluginPageAccountTree *page);
static void gnc_plugin_page_account_tree_cmd_scrub_all (GtkAction *action, GncPluginPageAccountTree *page);
static void gnc_plugin_page_account_tree_cmd_cascade_account_properties (GtkAction *action, GncPluginPageAccountTree *page);
static void gnc_plugin_page_account_tree_cmd_new_account (GSimpleAction *simple, GVariant *paramter, gpointer user_data);
static void gnc_plugin_page_account_tree_cmd_file_new_hierarchy (GSimpleAction *simple, GVariant *paramter, gpointer user_data);
static void gnc_plugin_page_account_tree_cmd_open_account (GSimpleAction *simple, GVariant *paramter, gpointer user_data);
static void gnc_plugin_page_account_tree_cmd_open_subaccounts (GSimpleAction *simple, GVariant *paramter, gpointer user_data);
static void gnc_plugin_page_account_tree_cmd_edit_account (GSimpleAction *simple, GVariant *paramter, gpointer user_data);
static void gnc_plugin_page_account_tree_cmd_find_account (GSimpleAction *simple, GVariant *paramter, gpointer user_data);
static void gnc_plugin_page_account_tree_cmd_find_account_popup (GSimpleAction *simple, GVariant *paramter, gpointer user_data);
static void gnc_plugin_page_account_tree_cmd_delete_account (GSimpleAction *simple, GVariant *paramter, gpointer user_data);
static void gnc_plugin_page_account_tree_cmd_renumber_accounts (GSimpleAction *simple, GVariant *paramter, gpointer user_data);
static void gnc_plugin_page_account_tree_cmd_view_filter_by (GSimpleAction *simple, GVariant *paramter, gpointer user_data);
static void gnc_plugin_page_account_tree_cmd_reconcile (GSimpleAction *simple, GVariant *paramter, gpointer user_data);
static void gnc_plugin_page_account_tree_cmd_refresh (GSimpleAction *simple, GVariant *paramter, gpointer user_data);
static void gnc_plugin_page_account_tree_cmd_autoclear (GSimpleAction *simple, GVariant *paramter, gpointer user_data);
static void gnc_plugin_page_account_tree_cmd_transfer (GSimpleAction *simple, GVariant *paramter, gpointer user_data);
static void gnc_plugin_page_account_tree_cmd_stock_split (GSimpleAction *simple, GVariant *paramter, gpointer user_data);
static void gnc_plugin_page_account_tree_cmd_stock_assistant (GSimpleAction *simple, GVariant *paramter, gpointer user_data);
static void gnc_plugin_page_account_tree_cmd_edit_tax_options (GSimpleAction *simple, GVariant *paramter, gpointer user_data);
static void gnc_plugin_page_account_tree_cmd_lots (GSimpleAction *simple, GVariant *paramter, gpointer user_data);
static void gnc_plugin_page_account_tree_cmd_scrub (GSimpleAction *simple, GVariant *paramter, gpointer user_data);
static void gnc_plugin_page_account_tree_cmd_scrub_sub (GSimpleAction *simple, GVariant *paramter, gpointer user_data);
static void gnc_plugin_page_account_tree_cmd_scrub_all (GSimpleAction *simple, GVariant *paramter, gpointer user_data);
static void gnc_plugin_page_account_tree_cmd_cascade_account_properties (GSimpleAction *simple, GVariant *paramter, gpointer user_data);
/* Account Deletion Actions. */
static int confirm_delete_account (GtkAction *action,
static int confirm_delete_account (GSimpleAction *simple,
GncPluginPageAccountTree *page, Account* ta,
Account* sta, Account* saa,
delete_helper_t delete_res);
@ -185,135 +185,51 @@ static void do_delete_account (Account* account, Account* saa, Account* sta,
static guint plugin_page_signals[LAST_SIGNAL] = { 0 };
static GtkActionEntry gnc_plugin_page_account_tree_actions [] =
static GActionEntry gnc_plugin_page_account_tree_actions [] =
{
/* Toplevel */
{ "FakeToplevel", NULL, "", NULL, NULL, NULL },
/* File menu */
{
"FileNewAccountAction", GNC_ICON_NEW_ACCOUNT, N_("New _Account…"), NULL,
N_("Create a new Account"),
G_CALLBACK (gnc_plugin_page_account_tree_cmd_new_account)
},
{
"FileAddAccountHierarchyAssistantAction", GNC_ICON_NEW_ACCOUNT, N_("New Account _Hierarchy…"), NULL,
N_("Extend the current book by merging with new account type categories"),
G_CALLBACK (gnc_plugin_page_account_tree_cmd_file_new_hierarchy)
},
{
"FileOpenAccountAction", GNC_ICON_OPEN_ACCOUNT, N_("Open _Account"), NULL,
N_("Open the selected account"),
G_CALLBACK (gnc_plugin_page_account_tree_cmd_open_account)
},
{
"FileOpenSubaccountsAction", GNC_ICON_OPEN_ACCOUNT, N_("Open _SubAccounts"), NULL,
N_("Open the selected account and all its subaccounts"),
G_CALLBACK (gnc_plugin_page_account_tree_cmd_open_subaccounts)
},
/* Edit menu */
{
"EditEditAccountAction", GNC_ICON_EDIT_ACCOUNT, N_("Edit _Account"), "<primary>e",
N_("Edit the selected account"),
G_CALLBACK (gnc_plugin_page_account_tree_cmd_edit_account)
},
{
"EditDeleteAccountAction", GNC_ICON_DELETE_ACCOUNT, N_("_Delete Account…"), "Delete",
N_("Delete selected account"),
G_CALLBACK (gnc_plugin_page_account_tree_cmd_delete_account)
},
{
"EditCascadeAccountAction", NULL, N_("_Cascade Account Properties…"), NULL,
N_("Cascade selected properties for account"),
G_CALLBACK (gnc_plugin_page_account_tree_cmd_cascade_account_properties)
},
{
"EditFindAccountAction", "edit-find", N_("F_ind Account"), "<primary>i",
N_("Find an account"),
G_CALLBACK (gnc_plugin_page_account_tree_cmd_find_account)
},
{
"EditFindAccountPopupAction", "edit-find", N_("F_ind Account"), "<primary>i",
N_("Find an account"),
G_CALLBACK (gnc_plugin_page_account_tree_cmd_find_account_popup)
},
{
"EditRenumberSubaccountsAction", NULL, N_("_Renumber Subaccounts…"), NULL,
N_("Renumber the children of the selected account"),
G_CALLBACK (gnc_plugin_page_account_tree_cmd_renumber_accounts)
},
{
"EditTaxOptionsAction", NULL,
/* Translators: remember to reuse this
translation in dialog-account.glade */
N_("Ta_x Report Options"), NULL,
/* Translators: currently implemented are
US: income tax and
DE: VAT
So adjust this string */
N_("Setup relevant accounts for tax reports, e.g. US income tax"),
G_CALLBACK (gnc_plugin_page_account_tree_cmd_edit_tax_options)
},
/* View menu */
{
"ViewFilterByAction", NULL, N_("_Filter By…"), NULL, NULL,
G_CALLBACK (gnc_plugin_page_account_tree_cmd_view_filter_by)
},
{
"ViewRefreshAction", "view-refresh", N_("_Refresh"), "<primary>r",
N_("Refresh this window"),
G_CALLBACK (gnc_plugin_page_account_tree_cmd_refresh)
},
/* Actions menu */
{
"ActionsReconcileAction", NULL, N_("_Reconcile…"), NULL,
N_("Reconcile the selected account"),
G_CALLBACK (gnc_plugin_page_account_tree_cmd_reconcile)
},
{
"ActionsAutoClearAction", NULL, N_("_Auto-clear…"), NULL,
N_("Automatically clear individual transactions, given a cleared amount"),
G_CALLBACK (gnc_plugin_page_account_tree_cmd_autoclear)
},
{
"ActionsTransferAction", NULL, N_("_Transfer…"), "<primary>t",
N_("Transfer funds from one account to another"),
G_CALLBACK (gnc_plugin_page_account_tree_cmd_transfer)
},
{
"ActionsStockSplitAction", NULL, N_("Stoc_k Split…"), NULL,
N_("Record a stock split or a stock merger"),
G_CALLBACK (gnc_plugin_page_account_tree_cmd_stock_split)
},
{
"ActionsLotsAction", NULL, N_("View _Lots…"), NULL,
N_("Bring up the lot viewer/editor window"),
G_CALLBACK (gnc_plugin_page_account_tree_cmd_lots)
},
{
"ScrubAction", NULL, N_("Check & Repair A_ccount"), NULL,
N_("Check for and repair unbalanced transactions and orphan splits " "in this account"),
G_CALLBACK (gnc_plugin_page_account_tree_cmd_scrub)
},
{
"ScrubSubAction", NULL, N_("Check & Repair Su_baccounts"), NULL,
N_("Check for and repair unbalanced transactions and orphan splits "
"in this account and its subaccounts"),
G_CALLBACK (gnc_plugin_page_account_tree_cmd_scrub_sub)
},
{
"ScrubAllAction", NULL, N_("Check & Repair A_ll"), NULL,
N_("Check for and repair unbalanced transactions and orphan splits " "in all accounts"),
G_CALLBACK (gnc_plugin_page_account_tree_cmd_scrub_all)
},
/* Extensions Menu */
{ "Register2TestAction", NULL, N_("_Register2"), NULL, NULL, NULL },
{ "FileNewAccountAction", gnc_plugin_page_account_tree_cmd_new_account, NULL, NULL, NULL },
{ "FileAddAccountHierarchyAssistantAction", gnc_plugin_page_account_tree_cmd_file_new_hierarchy, NULL, NULL, NULL },
{ "EditOpenAccountAction", gnc_plugin_page_account_tree_cmd_open_account, NULL, NULL, NULL },
{ "EditOpenSubaccountsAction", gnc_plugin_page_account_tree_cmd_open_subaccounts, NULL, NULL, NULL },
{ "EditEditAccountAction", gnc_plugin_page_account_tree_cmd_edit_account, NULL, NULL, NULL },
{ "EditDeleteAccountAction", gnc_plugin_page_account_tree_cmd_delete_account, NULL, NULL, NULL },
{ "EditCascadeAccountAction", gnc_plugin_page_account_tree_cmd_cascade_account_properties, NULL, NULL, NULL },
{ "EditFindAccountAction", gnc_plugin_page_account_tree_cmd_find_account, NULL, NULL, NULL },
{ "EditFindAccountPopupAction", gnc_plugin_page_account_tree_cmd_find_account_popup, NULL, NULL, NULL },
{ "EditRenumberSubaccountsAction", gnc_plugin_page_account_tree_cmd_renumber_accounts, NULL, NULL, NULL },
{ "EditTaxOptionsAction", gnc_plugin_page_account_tree_cmd_edit_tax_options, NULL, NULL, NULL },
{ "ViewFilterByAction", gnc_plugin_page_account_tree_cmd_view_filter_by, NULL, NULL, NULL },
{ "ViewRefreshAction", gnc_plugin_page_account_tree_cmd_refresh, NULL, NULL, NULL },
{ "ActionsReconcileAction", gnc_plugin_page_account_tree_cmd_reconcile, NULL, NULL, NULL },
{ "ActionsAutoClearAction", gnc_plugin_page_account_tree_cmd_autoclear, NULL, NULL, NULL },
{ "ActionsTransferAction", gnc_plugin_page_account_tree_cmd_transfer, NULL, NULL, NULL },
{ "ActionsStockSplitAction", gnc_plugin_page_account_tree_cmd_stock_split, NULL, NULL, NULL },
{ "ActionsStockAssistantAction", gnc_plugin_page_account_tree_cmd_stock_assistant, NULL, NULL, NULL },
{ "ActionsLotsAction", gnc_plugin_page_account_tree_cmd_lots, NULL, NULL, NULL },
{ "ScrubAction", gnc_plugin_page_account_tree_cmd_scrub, NULL, NULL, NULL },
{ "ScrubSubAction", gnc_plugin_page_account_tree_cmd_scrub_sub, NULL, NULL, NULL },
{ "ScrubAllAction", gnc_plugin_page_account_tree_cmd_scrub_all, NULL, NULL, NULL },
};
/** The number of actions provided by this plugin. */
static guint gnc_plugin_page_account_tree_n_actions = G_N_ELEMENTS (gnc_plugin_page_account_tree_actions);
static guint gnc_plugin_page_account_tree_n_actions = G_N_ELEMENTS(gnc_plugin_page_account_tree_actions);
/** The default menu items that need to be add to the menu */
static const gchar *gnc_plugin_load_ui_items [] =
{
"FilePlaceholder3",
"EditPlaceholder1",
"EditPlaceholder2",
"EditPlaceholder3",
"EditPlaceholder5",
"ViewPlaceholder1",
"ViewPlaceholder4",
"ActionsPlaceholder4",
"ActionsPlaceholder5",
"ActionsPlaceholder6",
NULL,
};
/** Actions that require an account to be selected before they are
@ -340,12 +256,18 @@ static const gchar *actions_requiring_subaccounts_rw[] =
* enabled. Those actions can be selected even if the book is in readonly mode. */
static const gchar *actions_requiring_account_always[] =
{
"FileOpenAccountAction",
"FileOpenSubaccountsAction",
"EditOpenAccountAction",
"EditOpenSubaccountsAction",
"ActionsLotsAction",
NULL
};
static const gchar* actions_requiring_priced_account[] =
{
"ActionsStockAssistantAction",
NULL
};
/* This is the list of actions which are switched inactive in a read-only book. */
static const gchar* readonly_inactive_actions[] =
{
@ -364,12 +286,12 @@ static const gchar* readonly_inactive_actions[] =
};
/** Short labels for use on the toolbar buttons. */
static action_toolbar_labels toolbar_labels[] =
static GncToolBarShortNames toolbar_labels[] =
{
{ "FileOpenAccountAction", N_("Open") },
{ "EditEditAccountAction", N_("Edit") },
{ "FileNewAccountAction", N_("New") },
{ "EditDeleteAccountAction", N_("Delete") },
{ "EditOpenAccountAction", N_("Open") },
{ "EditEditAccountAction", N_("Edit") },
{ "FileNewAccountAction", N_("New") },
{ "EditDeleteAccountAction", N_("Delete") },
{ NULL, NULL },
};
@ -468,7 +390,7 @@ 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 = NULL;
GncPluginPageAccountTreePrivate *priv;
GncPluginPage *parent;
const GList *page_list;
@ -478,35 +400,31 @@ gnc_plugin_page_account_tree_init (GncPluginPageAccountTree *plugin_page)
/* Init parent declared variables */
parent = GNC_PLUGIN_PAGE(plugin_page);
g_object_set(G_OBJECT(plugin_page),
"page-name", _("Accounts"),
"page-uri", "default:",
"ui-description", "gnc-plugin-page-account-tree-ui.xml",
NULL);
g_object_set (G_OBJECT(plugin_page),
"page-name", _("Accounts"),
"ui-description", "gnc-plugin-page-account-tree.ui",
NULL);
g_signal_connect (G_OBJECT (plugin_page), "selected",
G_CALLBACK (gnc_plugin_page_account_tree_selected), plugin_page);
/* 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());
/* Is this the first accounts page? */
page_list =
gnc_gobject_tracking_get_list(GNC_PLUGIN_PAGE_ACCOUNT_TREE_NAME);
gnc_gobject_tracking_get_list (GNC_PLUGIN_PAGE_ACCOUNT_TREE_NAME);
if (!page_list || plugin_page == page_list->data)
{
g_object_set_data(G_OBJECT(plugin_page), PLUGIN_PAGE_IMMUTABLE,
GINT_TO_POINTER(1));
g_object_set_data (G_OBJECT(plugin_page), PLUGIN_PAGE_IMMUTABLE,
GINT_TO_POINTER(1));
}
/* Create menu and toolbar information */
action_group =
gnc_plugin_page_create_action_group(parent,
"GncPluginPageAccountTreeActions");
gtk_action_group_add_actions(action_group,
gnc_plugin_page_account_tree_actions,
gnc_plugin_page_account_tree_n_actions,
plugin_page);
gnc_plugin_init_short_names (action_group, toolbar_labels);
simple_action_group = gnc_plugin_page_create_action_group (parent, "GncPluginPageAccountTreeActions");
g_action_map_add_action_entries (G_ACTION_MAP(simple_action_group),
gnc_plugin_page_account_tree_actions,
gnc_plugin_page_account_tree_n_actions,
plugin_page);
/* Visible types */
priv->fd.visible_types = -1; /* Start with all types */
@ -516,7 +434,7 @@ gnc_plugin_page_account_tree_init (GncPluginPageAccountTree *plugin_page)
priv->fd.filter_override = g_hash_table_new (g_direct_hash, g_direct_equal);
LEAVE("page %p, priv %p, action group %p",
plugin_page, priv, action_group);
plugin_page, priv, simple_action_group);
}
static void
@ -625,6 +543,24 @@ gnc_plugin_page_account_tree_focus_widget (GncPluginPage *account_plugin_page)
GncPluginPageAccountTreePrivate *priv = GNC_PLUGIN_PAGE_ACCOUNT_TREE_GET_PRIVATE(account_plugin_page);
GtkTreeView *view = GTK_TREE_VIEW(priv->tree_view);
/* Disable the Transaction Menu */
GAction *action = gnc_main_window_find_action (GNC_MAIN_WINDOW(account_plugin_page->window), "TransactionAction");
g_simple_action_set_enabled (G_SIMPLE_ACTION(action), FALSE);
/* Disable the Schedule menu */
action = gnc_main_window_find_action (GNC_MAIN_WINDOW(account_plugin_page->window), "ScheduledAction");
g_simple_action_set_enabled (G_SIMPLE_ACTION(action), FALSE);
gnc_main_window_update_menu_and_toolbar (GNC_MAIN_WINDOW(account_plugin_page->window),
account_plugin_page,
gnc_plugin_load_ui_items);
// setup any short toolbar names
gnc_main_window_init_short_names (GNC_MAIN_WINDOW(account_plugin_page->window), toolbar_labels);
/* Disable the FilePrintAction */
action = gnc_main_window_find_action (GNC_MAIN_WINDOW(account_plugin_page->window), "FilePrintAction");
g_simple_action_set_enabled (G_SIMPLE_ACTION(action), FALSE);
if (!gtk_widget_is_focus (GTK_WIDGET(view)))
gtk_widget_grab_focus (GTK_WIDGET(view));
}
@ -662,22 +598,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),
"EditDeleteAccountAction");
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),
"EditDeleteAccountAction");
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 *
@ -841,12 +777,13 @@ gnc_plugin_page_account_tree_destroy_widget (GncPluginPage *plugin_page)
LEAVE("widget destroyed");
}
static void update_inactive_actions(GncPluginPage *plugin_page)
static void
update_inactive_actions (GncPluginPage *plugin_page)
{
GncPluginPageAccountTreePrivate *priv;
GtkActionGroup *action_group;
GSimpleActionGroup *simple_action_group = NULL;
Account *account = NULL;
gboolean allow_write = !qof_book_is_readonly(gnc_get_current_book());
gboolean allow_write = !qof_book_is_readonly (gnc_get_current_book());
gboolean has_account = FALSE;
gboolean subaccounts = FALSE;
@ -863,18 +800,21 @@ 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_group (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,
"sensitive", allow_write);
gnc_plugin_update_actions (action_group, actions_requiring_account_rw,
"sensitive", allow_write && has_account);
gnc_plugin_update_actions (action_group, actions_requiring_account_always,
"sensitive", has_account);
gnc_plugin_update_actions (action_group, actions_requiring_subaccounts_rw,
"sensitive", allow_write && subaccounts);
gnc_plugin_set_actions_enabled (G_ACTION_MAP(simple_action_group), readonly_inactive_actions,
allow_write);
gnc_plugin_set_actions_enabled (G_ACTION_MAP(simple_action_group), actions_requiring_account_rw,
allow_write && has_account);
gnc_plugin_set_actions_enabled (G_ACTION_MAP(simple_action_group), actions_requiring_account_always,
has_account);
gnc_plugin_set_actions_enabled (G_ACTION_MAP(simple_action_group), actions_requiring_subaccounts_rw,
allow_write && subaccounts);
gnc_plugin_set_actions_enabled (G_ACTION_MAP(simple_action_group), actions_requiring_priced_account,
account && xaccAccountIsPriced (account));
g_signal_emit (plugin_page, plugin_page_signals[ACCOUNT_SELECTED], 0, account);
}
@ -882,7 +822,8 @@ static void update_inactive_actions(GncPluginPage *plugin_page)
* Called when this page is selected.
*
* Update the toolbar button sensitivity. */
static void gnc_plugin_page_account_tree_selected (GObject *object, gpointer user_data)
static void
gnc_plugin_page_account_tree_selected (GObject *object, gpointer user_data)
{
GncPluginPage *plugin_page = GNC_PLUGIN_PAGE (object);
g_return_if_fail (GNC_IS_PLUGIN_PAGE (plugin_page));
@ -934,8 +875,8 @@ gnc_plugin_page_account_tree_save_page (GncPluginPage *plugin_page,
* @param group_name The group name to use when restoring data. */
static GncPluginPage *
gnc_plugin_page_account_tree_recreate_page (GtkWidget *window,
GKeyFile *key_file,
const gchar *group_name)
GKeyFile *key_file,
const gchar *group_name)
{
GncPluginPageAccountTree *account_page;
GncPluginPageAccountTreePrivate *priv;
@ -963,7 +904,9 @@ gnc_plugin_page_account_tree_recreate_page (GtkWidget *window,
/* Callbacks */
static void
gnc_plugin_page_account_tree_summarybar_position_changed(gpointer prefs, gchar* pref, gpointer user_data)
gnc_plugin_page_account_tree_summarybar_position_changed (gpointer prefs,
gchar* pref,
gpointer user_data)
{
GncPluginPage *plugin_page;
GncPluginPageAccountTree *page;
@ -993,8 +936,8 @@ gnc_plugin_page_account_tree_summarybar_position_changed(gpointer prefs, gchar*
* registered in gnc-main-window.c. */
static gboolean
gnc_plugin_page_account_tree_button_press_cb (GtkWidget *widget,
GdkEventButton *event,
GncPluginPage *page)
GdkEventButton *event,
GncPluginPage *page)
{
g_return_val_if_fail(GNC_IS_PLUGIN_PAGE(page), FALSE);
@ -1028,9 +971,9 @@ gppat_open_account_common (GncPluginPageAccountTree *page,
static void
gnc_plugin_page_account_tree_double_click_cb (GtkTreeView *treeview,
GtkTreePath *path,
GtkTreeViewColumn *col,
GncPluginPageAccountTree *page)
GtkTreePath *path,
GtkTreeViewColumn *col,
GncPluginPageAccountTree *page)
{
GtkTreeModel *model;
GtkTreeIter iter;
@ -1076,8 +1019,11 @@ gnc_plugin_page_account_tree_selection_changed_cb (GtkTreeSelection *selection,
/* Command callbacks */
static void
gnc_plugin_page_account_tree_cmd_new_account (GtkAction *action, GncPluginPageAccountTree *page)
gnc_plugin_page_account_tree_cmd_new_account (GSimpleAction *simple,
GVariant *paramter,
gpointer user_data)
{
GncPluginPageAccountTree *page = user_data;
Account *account = gnc_plugin_page_account_tree_get_current_account (page);
GtkWindow *parent = GTK_WINDOW (gnc_plugin_page_get_window (GNC_PLUGIN_PAGE (page)));
gnc_ui_new_account_window (parent, gnc_get_current_book(),
@ -1085,15 +1031,20 @@ gnc_plugin_page_account_tree_cmd_new_account (GtkAction *action, GncPluginPageAc
}
static void
gnc_plugin_page_account_tree_cmd_file_new_hierarchy (GtkAction *action, GncPluginPageAccountTree *page)
gnc_plugin_page_account_tree_cmd_file_new_hierarchy (GSimpleAction *simple,
GVariant *paramter,
gpointer user_data)
{
GncPluginPageAccountTree *page = user_data;
gnc_ui_hierarchy_assistant(FALSE);
}
static void
gnc_plugin_page_account_tree_cmd_open_account (GtkAction *action,
GncPluginPageAccountTree *page)
gnc_plugin_page_account_tree_cmd_open_account (GSimpleAction *simple,
GVariant *paramter,
gpointer user_data)
{
GncPluginPageAccountTree *page = user_data;
Account *account;
g_return_if_fail (GNC_IS_PLUGIN_PAGE_ACCOUNT_TREE (page));
@ -1102,9 +1053,11 @@ gnc_plugin_page_account_tree_cmd_open_account (GtkAction *action,
}
static void
gnc_plugin_page_account_tree_cmd_open_subaccounts (GtkAction *action,
GncPluginPageAccountTree *page)
gnc_plugin_page_account_tree_cmd_open_subaccounts (GSimpleAction *simple,
GVariant *paramter,
gpointer user_data)
{
GncPluginPageAccountTree *page = user_data;
Account *account;
g_return_if_fail (GNC_IS_PLUGIN_PAGE_ACCOUNT_TREE (page));
@ -1113,11 +1066,14 @@ gnc_plugin_page_account_tree_cmd_open_subaccounts (GtkAction *action,
}
static void
gnc_plugin_page_account_tree_cmd_edit_account (GtkAction *action, GncPluginPageAccountTree *page)
gnc_plugin_page_account_tree_cmd_edit_account (GSimpleAction *simple,
GVariant *paramter,
gpointer user_data)
{
GncPluginPageAccountTree *page = user_data;
Account *account;
GtkWindow *parent = GTK_WINDOW (gnc_plugin_page_get_window (GNC_PLUGIN_PAGE (page)));
ENTER("action %p, page %p", action, page);
ENTER("action %p, page %p", simple, page);
account = gnc_plugin_page_account_tree_get_current_account (page);
g_return_if_fail (account != NULL);
@ -1127,11 +1083,14 @@ gnc_plugin_page_account_tree_cmd_edit_account (GtkAction *action, GncPluginPageA
}
static void
gnc_plugin_page_account_tree_cmd_find_account (GtkAction *action, GncPluginPageAccountTree *page)
gnc_plugin_page_account_tree_cmd_find_account (GSimpleAction *simple,
GVariant *paramter,
gpointer user_data)
{
GncPluginPageAccountTree *page = user_data;
GtkWidget *window;
ENTER("action %p, page %p", action, page);
ENTER("action %p, page %p", simple, page);
window = gnc_plugin_page_get_window(GNC_PLUGIN_PAGE(page));
@ -1140,12 +1099,15 @@ gnc_plugin_page_account_tree_cmd_find_account (GtkAction *action, GncPluginPageA
}
static void
gnc_plugin_page_account_tree_cmd_find_account_popup (GtkAction *action, GncPluginPageAccountTree *page)
gnc_plugin_page_account_tree_cmd_find_account_popup (GSimpleAction *simple,
GVariant *paramter,
gpointer user_data)
{
GncPluginPageAccountTree *page = user_data;
Account *account = NULL;
GtkWidget *window;
ENTER("action %p, page %p", action, page);
ENTER("action %p, page %p", simple, page);
account = gnc_plugin_page_account_tree_get_current_account (page);
@ -1156,12 +1118,15 @@ gnc_plugin_page_account_tree_cmd_find_account_popup (GtkAction *action, GncPlugi
}
static void
gnc_plugin_page_account_tree_cmd_cascade_account_properties (GtkAction *action, GncPluginPageAccountTree *page)
gnc_plugin_page_account_tree_cmd_cascade_account_properties (GSimpleAction *simple,
GVariant *paramter,
gpointer user_data)
{
GncPluginPageAccountTree *page = user_data;
Account *account = NULL;
GtkWidget *window;
ENTER("action %p, page %p", action, page);
ENTER("action %p, page %p", simple, page);
account = gnc_plugin_page_account_tree_get_current_account (page);
@ -1507,8 +1472,11 @@ account_delete_dialog (Account *account, GtkWindow *parent, Adopters* adopt)
}
static void
gnc_plugin_page_account_tree_cmd_delete_account (GtkAction *action, GncPluginPageAccountTree *page)
gnc_plugin_page_account_tree_cmd_delete_account (GSimpleAction *simple,
GVariant *paramter,
gpointer user_data)
{
GncPluginPageAccountTree *page = user_data;
Account *account = gnc_plugin_page_account_tree_get_current_account (page);
gchar *acct_name;
GtkWidget *window;
@ -1579,10 +1547,10 @@ gnc_plugin_page_account_tree_cmd_delete_account (GtkAction *action, GncPluginPag
adopter_match (&adopt.subtrans, GTK_WINDOW (window)))
break;
}
filter = g_object_get_data (G_OBJECT (dialog), DELETE_DIALOG_FILTER);
filter = g_object_get_data (G_OBJECT (dialog), DELETE_DIALOG_FILTER);
gtk_widget_destroy(dialog);
g_list_free(filter);
if (confirm_delete_account (action, page, adopt.trans.new_account,
if (confirm_delete_account (simple, page, adopt.trans.new_account,
adopt.subtrans.new_account,
adopt.subacct.new_account,
adopt.delete_res) == GTK_RESPONSE_ACCEPT)
@ -1593,7 +1561,7 @@ gnc_plugin_page_account_tree_cmd_delete_account (GtkAction *action, GncPluginPag
}
static int
confirm_delete_account (GtkAction *action, GncPluginPageAccountTree *page,
confirm_delete_account (GSimpleAction *simple, GncPluginPageAccountTree *page,
Account* ta, Account* sta, Account* saa,
delete_helper_t delete_res)
{
@ -1678,7 +1646,8 @@ confirm_delete_account (GtkAction *action, GncPluginPageAccountTree *page,
return response;
}
void do_delete_account (Account* account, Account* saa, Account* sta, Account* ta)
void
do_delete_account (Account* account, Account* saa, Account* sta, Account* ta)
{
GList *acct_list, *ptr;
const GncGUID *guid;
@ -1741,9 +1710,11 @@ void do_delete_account (Account* account, Account* saa, Account* sta, Account* t
}
static void
gnc_plugin_page_account_tree_cmd_renumber_accounts (GtkAction *action,
GncPluginPageAccountTree *page)
gnc_plugin_page_account_tree_cmd_renumber_accounts (GSimpleAction *simple,
GVariant *paramter,
gpointer user_data)
{
GncPluginPageAccountTree *page = user_data;
Account *account;
GtkWidget *window;
@ -1756,9 +1727,11 @@ gnc_plugin_page_account_tree_cmd_renumber_accounts (GtkAction *action,
}
static void
gnc_plugin_page_account_tree_cmd_refresh (GtkAction *action,
GncPluginPageAccountTree *page)
gnc_plugin_page_account_tree_cmd_refresh (GSimpleAction *simple,
GVariant *paramter,
gpointer user_data)
{
GncPluginPageAccountTree *page = user_data;
GncPluginPageAccountTreePrivate *priv;
g_return_if_fail(GNC_IS_PLUGIN_PAGE_ACCOUNT_TREE(page));
@ -1772,13 +1745,15 @@ gnc_plugin_page_account_tree_cmd_refresh (GtkAction *action,
/*********************/
static void
gnc_plugin_page_account_tree_cmd_view_filter_by (GtkAction *action,
GncPluginPageAccountTree *page)
gnc_plugin_page_account_tree_cmd_view_filter_by (GSimpleAction *simple,
GVariant *paramter,
gpointer user_data)
{
GncPluginPageAccountTree *page = user_data;
GncPluginPageAccountTreePrivate *priv;
g_return_if_fail(GNC_IS_PLUGIN_PAGE_ACCOUNT_TREE(page));
ENTER("(action %p, page %p)", action, page);
ENTER("(action %p, page %p)", simple, page);
priv = GNC_PLUGIN_PAGE_ACCOUNT_TREE_GET_PRIVATE(page);
account_filter_dialog_create(&priv->fd, GNC_PLUGIN_PAGE(page));
@ -1786,9 +1761,11 @@ gnc_plugin_page_account_tree_cmd_view_filter_by (GtkAction *action,
}
static void
gnc_plugin_page_account_tree_cmd_reconcile (GtkAction *action,
GncPluginPageAccountTree *page)
gnc_plugin_page_account_tree_cmd_reconcile (GSimpleAction *simple,
GVariant *paramter,
gpointer user_data)
{
GncPluginPageAccountTree *page = user_data;
GtkWidget *window;
Account *account;
RecnWindow *recnData;
@ -1802,9 +1779,11 @@ gnc_plugin_page_account_tree_cmd_reconcile (GtkAction *action,
}
static void
gnc_plugin_page_account_tree_cmd_autoclear (GtkAction *action,
GncPluginPageAccountTree *page)
gnc_plugin_page_account_tree_cmd_autoclear (GSimpleAction *simple,
GVariant *paramter,
gpointer user_data)
{
GncPluginPageAccountTree *page = user_data;
GtkWidget *window;
Account *account;
AutoClearWindow *autoClearData;
@ -1818,9 +1797,11 @@ gnc_plugin_page_account_tree_cmd_autoclear (GtkAction *action,
}
static void
gnc_plugin_page_account_tree_cmd_transfer (GtkAction *action,
GncPluginPageAccountTree *page)
gnc_plugin_page_account_tree_cmd_transfer (GSimpleAction *simple,
GVariant *paramter,
gpointer user_data)
{
GncPluginPageAccountTree *page = user_data;
GtkWidget *window;
Account *account;
@ -1830,9 +1811,11 @@ gnc_plugin_page_account_tree_cmd_transfer (GtkAction *action,
}
static void
gnc_plugin_page_account_tree_cmd_stock_split (GtkAction *action,
GncPluginPageAccountTree *page)
gnc_plugin_page_account_tree_cmd_stock_split (GSimpleAction *simple,
GVariant *paramter,
gpointer user_data)
{
GncPluginPageAccountTree *page = user_data;
GtkWidget *window;
Account *account;
@ -1842,9 +1825,30 @@ gnc_plugin_page_account_tree_cmd_stock_split (GtkAction *action,
}
static void
gnc_plugin_page_account_tree_cmd_edit_tax_options (GtkAction *action,
GncPluginPageAccountTree *page)
gnc_plugin_page_account_tree_cmd_stock_assistant (GSimpleAction *simple,
GVariant *paramter,
gpointer user_data)
{
GncPluginPageAccountTree *page = user_data;
Account *account;
GtkWidget *window;
ENTER ("(action %p, page %p)", simple, page);
g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER (page));
account = gnc_plugin_page_account_tree_get_current_account (page);
window = GNC_PLUGIN_PAGE(page)->window;
gnc_stock_transaction_assistant (window, account);
LEAVE (" ");
}
static void
gnc_plugin_page_account_tree_cmd_edit_tax_options (GSimpleAction *simple,
GVariant *paramter,
gpointer user_data)
{
GncPluginPageAccountTree *page = user_data;
GtkWidget *window;
Account *account;
@ -1854,15 +1858,18 @@ gnc_plugin_page_account_tree_cmd_edit_tax_options (GtkAction *action,
}
static void
gnc_plugin_page_account_tree_cmd_lots (GtkAction *action,
GncPluginPageAccountTree *page)
gnc_plugin_page_account_tree_cmd_lots (GSimpleAction *simple,
GVariant *paramter,
gpointer user_data)
{
GncPluginPageAccountTree *page = user_data;
Account *account = gnc_plugin_page_account_tree_get_current_account (page);
GtkWidget *window = GNC_PLUGIN_PAGE (page)->window;
gnc_lot_viewer_dialog (GTK_WINDOW(window), account);
}
static gboolean scrub_kp_handler (GtkWidget *widget, GdkEventKey *event, gpointer data)
static gboolean
scrub_kp_handler (GtkWidget *widget, GdkEventKey *event, gpointer data)
{
if (event->length == 0) return FALSE;
@ -1885,8 +1892,11 @@ static gboolean scrub_kp_handler (GtkWidget *widget, GdkEventKey *event, gpointe
}
static void
gnc_plugin_page_account_tree_cmd_scrub (GtkAction *action, GncPluginPageAccountTree *page)
gnc_plugin_page_account_tree_cmd_scrub (GSimpleAction *simple,
GVariant *paramter,
gpointer user_data)
{
GncPluginPageAccountTree *page = user_data;
Account *account = gnc_plugin_page_account_tree_get_current_account (page);
GncWindow *window;
gulong scrub_kp_handler_ID;
@ -1913,8 +1923,11 @@ gnc_plugin_page_account_tree_cmd_scrub (GtkAction *action, GncPluginPageAccountT
}
static void
gnc_plugin_page_account_tree_cmd_scrub_sub (GtkAction *action, GncPluginPageAccountTree *page)
gnc_plugin_page_account_tree_cmd_scrub_sub (GSimpleAction *simple,
GVariant *paramter,
gpointer user_data)
{
GncPluginPageAccountTree *page = user_data;
Account *account = gnc_plugin_page_account_tree_get_current_account (page);
GncWindow *window;
gulong scrub_kp_handler_ID;
@ -1941,8 +1954,11 @@ gnc_plugin_page_account_tree_cmd_scrub_sub (GtkAction *action, GncPluginPageAcco
}
static void
gnc_plugin_page_account_tree_cmd_scrub_all (GtkAction *action, GncPluginPageAccountTree *page)
gnc_plugin_page_account_tree_cmd_scrub_all (GSimpleAction *simple,
GVariant *paramter,
gpointer user_data)
{
GncPluginPageAccountTree *page = user_data;
Account *root = gnc_get_current_root_account ();
GncWindow *window;
gulong scrub_kp_handler_ID;

View File

@ -110,95 +110,48 @@ static void gppb_selection_changed_cb (GtkTreeSelection *selection,
GncPluginPageBudget *page);
#endif
static void gnc_plugin_page_budget_cmd_view_filter_by (GtkAction *action,
GncPluginPageBudget *page);
static void gnc_plugin_page_budget_cmd_view_filter_by (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
static void gnc_plugin_page_budget_cmd_open_account (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
static void gnc_plugin_page_budget_cmd_open_subaccounts (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
static void gnc_plugin_page_budget_cmd_delete_budget (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
static void gnc_plugin_page_budget_cmd_view_options (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
static void gnc_plugin_page_budget_cmd_estimate_budget (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
static void gnc_plugin_page_budget_cmd_allperiods_budget (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
static void gnc_plugin_page_budget_cmd_refresh (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
static void gnc_plugin_page_budget_cmd_budget_note (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
static void gnc_plugin_page_budget_cmd_budget_report (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
static void gnc_plugin_page_budget_cmd_edit_tax_options (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
/* Command Callbacks */
static void gnc_plugin_page_budget_cmd_open_account (GtkAction *action,
GncPluginPageBudget *page);
static void gnc_plugin_page_budget_cmd_open_subaccounts (GtkAction *action,
GncPluginPageBudget *page);
static void gnc_plugin_page_budget_cmd_delete_budget (GtkAction *action,
GncPluginPageBudget *page);
static void gnc_plugin_page_budget_cmd_view_options (GtkAction *action,
GncPluginPageBudget *page);
static void gnc_plugin_page_budget_cmd_estimate_budget (GtkAction *action,
GncPluginPageBudget *page);
static void gnc_plugin_page_budget_cmd_allperiods_budget (GtkAction *action,
GncPluginPageBudget *page);
static void gnc_plugin_page_budget_cmd_refresh (GtkAction *action,
GncPluginPageBudget *page);
static void gnc_plugin_page_budget_cmd_budget_note (GtkAction *action,
GncPluginPageBudget *page);
static void gnc_plugin_page_budget_cmd_budget_report (GtkAction *action,
GncPluginPageBudget *page);
static void allperiods_budget_helper (GtkTreeModel *model, GtkTreePath *path,
GtkTreeIter *iter, gpointer data);
static GtkActionEntry gnc_plugin_page_budget_actions [] =
static GActionEntry gnc_plugin_page_budget_actions [] =
{
/* Toplevel */
{ "FakeToplevel", "", NULL, NULL, NULL, NULL },
/* File menu */
{
"OpenAccountAction", GNC_ICON_OPEN_ACCOUNT, N_("Open _Account"), NULL,
N_("Open the selected account."),
G_CALLBACK(gnc_plugin_page_budget_cmd_open_account)
},
{
"OpenSubaccountsAction", GNC_ICON_OPEN_ACCOUNT,
N_("Open _Subaccounts"), NULL,
N_("Open the selected account and all its subaccounts."),
G_CALLBACK(gnc_plugin_page_budget_cmd_open_subaccounts)
},
/* Edit menu */
{
"DeleteBudgetAction", GNC_ICON_DELETE_BUDGET, N_("_Delete Budget…"),
NULL, N_("Select this or another budget and delete it."),
G_CALLBACK(gnc_plugin_page_budget_cmd_delete_budget)
},
{
"OptionsBudgetAction", "document-properties", N_("Budget _Options…"),
NULL, N_("Edit this budget's options."),
G_CALLBACK(gnc_plugin_page_budget_cmd_view_options)
},
{
"EstimateBudgetAction", "system-run", N_("Esti_mate Budget…"),
NULL,
N_("Estimate a budget value for the selected accounts from past transactions."),
G_CALLBACK(gnc_plugin_page_budget_cmd_estimate_budget)
},
{
"AllPeriodsBudgetAction", "system-run", N_("_All Periods…"),
NULL,
N_("Edit budget for all periods for the selected accounts."),
G_CALLBACK(gnc_plugin_page_budget_cmd_allperiods_budget)
},
{
"BudgetNoteAction", "text-x-generic", N_("Edit Note"),
NULL,
N_("Edit note for the selected account and period."),
G_CALLBACK (gnc_plugin_page_budget_cmd_budget_note)
},
{
"BudgetReportAction", "system-run", N_("Budget Report"),
NULL,
N_("Run the budget report."),
G_CALLBACK (gnc_plugin_page_budget_cmd_budget_report)
},
/* View menu */
{
"ViewFilterByAction", NULL, N_("_Filter By…"), NULL, NULL,
G_CALLBACK(gnc_plugin_page_budget_cmd_view_filter_by)
},
{
"ViewRefreshAction", "view-refresh", N_("_Refresh"), "<primary>r",
N_("Refresh this window."),
G_CALLBACK(gnc_plugin_page_budget_cmd_refresh)
},
{ "OpenAccountAction", gnc_plugin_page_budget_cmd_open_account, NULL, NULL, NULL },
{ "OpenSubaccountsAction", gnc_plugin_page_budget_cmd_open_subaccounts, NULL, NULL, NULL },
{ "DeleteBudgetAction", gnc_plugin_page_budget_cmd_delete_budget, NULL, NULL, NULL },
{ "OptionsBudgetAction", gnc_plugin_page_budget_cmd_view_options, NULL, NULL, NULL },
{ "EstimateBudgetAction", gnc_plugin_page_budget_cmd_estimate_budget, NULL, NULL, NULL },
{ "AllPeriodsBudgetAction", gnc_plugin_page_budget_cmd_allperiods_budget, NULL, NULL, NULL },
{ "BudgetNoteAction", gnc_plugin_page_budget_cmd_budget_note, NULL, NULL, NULL },
{ "BudgetReportAction", gnc_plugin_page_budget_cmd_budget_report, NULL, NULL, NULL },
{ "ViewFilterByAction", gnc_plugin_page_budget_cmd_view_filter_by, NULL, NULL, NULL },
{ "ViewRefreshAction", gnc_plugin_page_budget_cmd_refresh, NULL, NULL, NULL },
{ "EditTaxOptionsAction", gnc_plugin_page_budget_cmd_edit_tax_options, NULL, NULL, NULL },
};
static guint gnc_plugin_page_budget_n_actions = G_N_ELEMENTS(gnc_plugin_page_budget_actions);
/** The default menu items that need to be add to the menu */
static const gchar *gnc_plugin_load_ui_items [] =
{
"FilePlaceholder3",
"EditPlaceholder1",
"EditPlaceholder3",
"EditPlaceholder5",
"EditPlaceholder6",
"ViewPlaceholder1",
"ViewPlaceholder4",
NULL,
};
static const gchar *writeable_actions[] =
@ -212,9 +165,6 @@ static const gchar *writeable_actions[] =
NULL
};
static guint gnc_plugin_page_budget_n_actions =
G_N_ELEMENTS(gnc_plugin_page_budget_actions);
#if 0
static const gchar *actions_requiring_account[] =
{
@ -225,7 +175,7 @@ static const gchar *actions_requiring_account[] =
#endif
/** Short labels for use on the toolbar buttons. */
static action_toolbar_labels toolbar_labels[] =
static GncToolBarShortNames toolbar_labels[] =
{
{ "OpenAccountAction", N_("Open") },
{ "DeleteBudgetAction", N_("Delete") },
@ -247,9 +197,8 @@ typedef enum allperiods_action
typedef struct GncPluginPageBudgetPrivate
{
GtkActionGroup *action_group;
guint merge_id;
GtkUIManager *ui_merge;
GtkBuilder *builder;
GSimpleActionGroup *simple_action_group;
GncBudgetView* budget_view;
GtkTreeView *tree_view;
@ -348,7 +297,7 @@ 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;
@ -359,26 +308,22 @@ gnc_plugin_page_budget_init (GncPluginPageBudget *plugin_page)
parent = GNC_PLUGIN_PAGE(plugin_page);
g_object_set (G_OBJECT(plugin_page),
"page-name", _("Budget"),
"page-uri", "default:",
"ui-description", "gnc-plugin-page-budget-ui.xml",
"ui-description", "gnc-plugin-page-budget.ui",
NULL);
/* change me when the system supports multiple books */
gnc_plugin_page_add_book (parent, gnc_get_current_book());
/* Create menu and toolbar information */
action_group =
gnc_plugin_page_create_action_group (parent,
"GncPluginPageBudgetActions");
gtk_action_group_add_actions (action_group,
gnc_plugin_page_budget_actions,
gnc_plugin_page_budget_n_actions,
plugin_page);
gnc_plugin_init_short_names (action_group, toolbar_labels);
simple_action_group = gnc_plugin_page_create_action_group (parent, "GncPluginPageBudgetActions");
g_action_map_add_action_entries (G_ACTION_MAP(simple_action_group),
gnc_plugin_page_budget_actions,
gnc_plugin_page_budget_n_actions,
plugin_page);
if (qof_book_is_readonly (gnc_get_current_book()))
gnc_plugin_update_actions (action_group, writeable_actions,
"sensitive", FALSE);
gnc_plugin_set_actions_enabled (G_ACTION_MAP(simple_action_group), writeable_actions,
FALSE);
/* Visible types */
priv->fd.visible_types = -1; /* Start with all types */
@ -392,7 +337,7 @@ gnc_plugin_page_budget_init (GncPluginPageBudget *plugin_page)
recurrenceSet (&priv->r, 1, PERIOD_MONTH, NULL, WEEKEND_ADJ_NONE);
LEAVE("page %p, priv %p, action group %p",
plugin_page, priv, action_group);
plugin_page, priv, simple_action_group);
}
@ -432,6 +377,23 @@ gnc_plugin_page_budget_focus_widget (GncPluginPage *budget_plugin_page)
GncBudgetView *budget_view = priv->budget_view;
GtkWidget *account_view = gnc_budget_view_get_account_tree_view (budget_view);
/* Disable the Transaction Menu */
GAction *action = gnc_main_window_find_action (GNC_MAIN_WINDOW(budget_plugin_page->window), "TransactionAction");
g_simple_action_set_enabled (G_SIMPLE_ACTION(action), FALSE);
/* Disable the Schedule menu */
action = gnc_main_window_find_action (GNC_MAIN_WINDOW(budget_plugin_page->window), "ScheduledAction");
g_simple_action_set_enabled (G_SIMPLE_ACTION(action), FALSE);
/* Disable the FilePrintAction */
action = gnc_main_window_find_action (GNC_MAIN_WINDOW(budget_plugin_page->window), "FilePrintAction");
g_simple_action_set_enabled (G_SIMPLE_ACTION(action), FALSE);
gnc_main_window_update_menu_and_toolbar (GNC_MAIN_WINDOW(budget_plugin_page->window),
budget_plugin_page,
gnc_plugin_load_ui_items);
// setup any short toolbar names
gnc_main_window_init_short_names (GNC_MAIN_WINDOW(budget_plugin_page->window), toolbar_labels);
if (!gtk_widget_is_focus (GTK_WIDGET(account_view)))
gtk_widget_grab_focus (GTK_WIDGET(account_view));
}
@ -721,7 +683,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;
@ -742,9 +704,9 @@ 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,
"sensitive", sensitive);
simple_action_group = gnc_plugin_page_get_action_group (GNC_PLUGIN_PAGE(page));
gnc_plugin_set_actions_enabled (G_ACTION_MAP(simple_action_group), actions_requiring_account,
sensitive);
}
#endif
@ -753,9 +715,11 @@ gppb_selection_changed_cb (GtkTreeSelection *selection,
* Command callbacks *
********************/
static void
gnc_plugin_page_budget_cmd_open_account (GtkAction *action,
GncPluginPageBudget *page)
gnc_plugin_page_budget_cmd_open_account (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
GncPluginPageBudget *page = user_data;
GncPluginPageBudgetPrivate *priv;
GtkWidget *window;
GncPluginPage *new_page;
@ -778,9 +742,11 @@ gnc_plugin_page_budget_cmd_open_account (GtkAction *action,
static void
gnc_plugin_page_budget_cmd_open_subaccounts (GtkAction *action,
GncPluginPageBudget *page)
gnc_plugin_page_budget_cmd_open_subaccounts (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
GncPluginPageBudget *page = user_data;
GncPluginPageBudgetPrivate *priv;
GtkWidget *window;
GncPluginPage *new_page;
@ -803,9 +769,11 @@ gnc_plugin_page_budget_cmd_open_subaccounts (GtkAction *action,
static void
gnc_plugin_page_budget_cmd_delete_budget (GtkAction *action,
GncPluginPageBudget *page)
gnc_plugin_page_budget_cmd_delete_budget (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
GncPluginPageBudget *page = user_data;
GncPluginPageBudgetPrivate *priv;
GncBudget *budget;
@ -818,13 +786,47 @@ gnc_plugin_page_budget_cmd_delete_budget (GtkAction *action,
}
static void
gnc_plugin_page_budget_cmd_edit_tax_options (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
GncPluginPageBudget *page = user_data;
GncPluginPageBudgetPrivate *priv;
GtkTreeSelection *selection;
Account *account = NULL;
GtkWidget *window;
page = GNC_PLUGIN_PAGE_BUDGET(page);
g_return_if_fail (GNC_IS_PLUGIN_PAGE_BUDGET(page));
ENTER ("(action %p, page %p)", simple, page);
priv = GNC_PLUGIN_PAGE_BUDGET_GET_PRIVATE(page);
selection = gnc_budget_view_get_selection (priv->budget_view);
window = GNC_PLUGIN_PAGE(page)->window;
if (gtk_tree_selection_count_selected_rows (selection) == 1)
{
GList *acc_list = gnc_budget_view_get_selected_accounts (priv->budget_view);
GList *node = g_list_first (acc_list);
account = acc_list->data;
g_list_free (acc_list);
}
gnc_tax_info_dialog (window, account);
LEAVE (" ");
}
/******************************/
/* Options Dialog */
/******************************/
static void
gnc_plugin_page_budget_cmd_view_options (GtkAction *action,
GncPluginPageBudget *page)
gnc_plugin_page_budget_cmd_view_options (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
GncPluginPageBudget *page = user_data;
GncPluginPageBudgetPrivate *priv;
GncRecurrence *gr;
GtkBuilder *builder;
@ -1019,9 +1021,11 @@ estimate_budget_helper (GtkTreeModel *model, GtkTreePath *path,
/* Estimate Dialog */
/*******************************/
static void
gnc_plugin_page_budget_cmd_estimate_budget (GtkAction *action,
GncPluginPageBudget *page)
gnc_plugin_page_budget_cmd_estimate_budget (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
GncPluginPageBudget *page = user_data;
GncPluginPageBudgetPrivate *priv;
GtkTreeSelection *sel;
GtkWidget *dialog, *gde, *dtr, *hb, *avg;
@ -1148,9 +1152,11 @@ allperiods_budget_helper (GtkTreeModel *model, GtkTreePath *path,
/* All Periods Value Dialog */
/*******************************/
static void
gnc_plugin_page_budget_cmd_allperiods_budget (GtkAction *action,
GncPluginPageBudget *page)
gnc_plugin_page_budget_cmd_allperiods_budget (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
GncPluginPageBudget *page = user_data;
GncPluginPageBudgetPrivate *priv;
GtkTreeSelection *sel;
GtkWidget *dialog, *gde, *val, *dtr, *add, *mult;
@ -1232,9 +1238,11 @@ gnc_plugin_page_budget_cmd_allperiods_budget (GtkAction *action,
}
static void
gnc_plugin_page_budget_cmd_budget_note(GtkAction *action,
GncPluginPageBudget *page)
gnc_plugin_page_budget_cmd_budget_note (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
GncPluginPageBudget *page = user_data;
GncPluginPageBudgetPrivate *priv;
GtkTreeSelection *sel;
GtkWidget *dialog, *note;
@ -1320,9 +1328,11 @@ equal_fn (gpointer find_data, gpointer elt_data)
whereby report's report-type matches a budget report, and the
report's budget option value matches the current budget. */
static void
gnc_plugin_page_budget_cmd_budget_report (GtkAction *action,
GncPluginPageBudget *page)
gnc_plugin_page_budget_cmd_budget_report (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
GncPluginPageBudget *page = user_data;
GncPluginPageBudgetPrivate *priv;
g_return_if_fail (GNC_IS_PLUGIN_PAGE_BUDGET (page));
@ -1353,13 +1363,15 @@ gnc_plugin_page_budget_cmd_budget_report (GtkAction *action,
}
static void
gnc_plugin_page_budget_cmd_view_filter_by (GtkAction *action,
GncPluginPageBudget *page)
gnc_plugin_page_budget_cmd_view_filter_by (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
GncPluginPageBudget *page = user_data;
GncPluginPageBudgetPrivate *priv;
g_return_if_fail(GNC_IS_PLUGIN_PAGE_BUDGET(page));
ENTER("(action %p, page %p)", action, page);
ENTER("(action %p, page %p)", simple, page);
priv = GNC_PLUGIN_PAGE_BUDGET_GET_PRIVATE(page);
account_filter_dialog_create (&priv->fd, GNC_PLUGIN_PAGE(page));
@ -1368,13 +1380,15 @@ gnc_plugin_page_budget_cmd_view_filter_by (GtkAction *action,
}
static void
gnc_plugin_page_budget_cmd_refresh (GtkAction *action,
GncPluginPageBudget *page)
gnc_plugin_page_budget_cmd_refresh (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
GncPluginPageBudget *page = user_data;
GncPluginPageBudgetPrivate *priv;
g_return_if_fail (GNC_IS_PLUGIN_PAGE_BUDGET(page));
ENTER("(action %p, page %p)", action, page);
ENTER("(action %p, page %p)", simple, page);
priv = GNC_PLUGIN_PAGE_BUDGET_GET_PRIVATE(page);

File diff suppressed because it is too large Load Diff

View File

@ -70,7 +70,7 @@ static QofLogModule log_module = GNC_MOD_GUI;
#define PLUGIN_PAGE_ACCT_TREE_CM_CLASS "plugin-page-owner-tree"
#define DELETE_DIALOG_FILTER "filter"
#define DELETE_DIALOG_OWNER "owner"
#define DELETE_DIALOG_OWNER "owner"
enum
{
@ -107,142 +107,78 @@ static GtkWidget *gnc_plugin_page_owner_tree_create_widget (GncPluginPage *plugi
static void gnc_plugin_page_owner_tree_destroy_widget (GncPluginPage *plugin_page);
static void gnc_plugin_page_owner_tree_save_page (GncPluginPage *plugin_page, GKeyFile *file, const gchar *group);
static GncPluginPage *gnc_plugin_page_owner_tree_recreate_page (GtkWidget *window, GKeyFile *file, const gchar *group);
static void set_menu_and_toolbar_qualifier (GncPluginPage *plugin_page);
/* Callbacks */
static gboolean gnc_plugin_page_owner_tree_button_press_cb (GtkWidget *widget,
GdkEventButton *event,
GncPluginPage *page);
static void gnc_plugin_page_owner_tree_double_click_cb (GtkTreeView *treeview,
GtkTreePath *path,
GtkTreeViewColumn *col,
GncPluginPageOwnerTree *page);
GdkEventButton *event,
GncPluginPage *page);
static void gnc_plugin_page_owner_tree_double_click_cb (GtkTreeView *treeview,
GtkTreePath *path,
GtkTreeViewColumn *col,
GncPluginPageOwnerTree *page);
static void gnc_plugin_page_owner_tree_selection_changed_cb (GtkTreeSelection *selection,
GncPluginPageOwnerTree *page);
GncPluginPageOwnerTree *page);
/* Command callbacks */
static void gnc_plugin_page_owner_tree_cmd_new_owner (GtkAction *action, GncPluginPageOwnerTree *page);
static void gnc_plugin_page_owner_tree_cmd_edit_owner (GtkAction *action, GncPluginPageOwnerTree *page);
static void gnc_plugin_page_owner_tree_cmd_new_owner (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
static void gnc_plugin_page_owner_tree_cmd_edit_owner (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
#if 0 /* Disabled due to crash */
static void gnc_plugin_page_owner_tree_cmd_delete_owner (GtkAction *action, GncPluginPageOwnerTree *page);
static void gnc_plugin_page_owner_tree_cmd_delete_owner (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
#endif
static void gnc_plugin_page_owner_tree_cmd_view_filter_by (GtkAction *action, GncPluginPageOwnerTree *page);
static void gnc_plugin_page_owner_tree_cmd_refresh (GtkAction *action, GncPluginPageOwnerTree *page);
static void gnc_plugin_page_owner_tree_cmd_new_invoice (GtkAction *action, GncPluginPageOwnerTree *page);
static void gnc_plugin_page_owner_tree_cmd_owners_report (GtkAction *action, GncPluginPageOwnerTree *plugin_page);
static void gnc_plugin_page_owner_tree_cmd_owner_report (GtkAction *action, GncPluginPageOwnerTree *plugin_page);
static void gnc_plugin_page_owner_tree_cmd_process_payment (GtkAction *action, GncPluginPageOwnerTree *plugin_page);
static void gnc_plugin_page_owner_tree_cmd_view_filter_by (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
static void gnc_plugin_page_owner_tree_cmd_refresh (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
static void gnc_plugin_page_owner_tree_cmd_new_invoice (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
static void gnc_plugin_page_owner_tree_cmd_owners_report (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
static void gnc_plugin_page_owner_tree_cmd_owner_report (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
static void gnc_plugin_page_owner_tree_cmd_process_payment (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
static void gnc_plugin_page_owner_tree_cmd_edit_tax (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
static guint plugin_page_signals[LAST_SIGNAL] = { 0 };
static GtkActionEntry gnc_plugin_page_owner_tree_actions [] =
static GActionEntry gnc_plugin_page_owner_tree_actions [] =
{
/* Toplevel */
{ "FakeToplevel", NULL, "", NULL, NULL, NULL },
/* Edit menu */
{
"OTEditVendorAction", GNC_ICON_EDIT_ACCOUNT, N_("E_dit Vendor"), "<primary>e",
N_("Edit the selected vendor"),
G_CALLBACK (gnc_plugin_page_owner_tree_cmd_edit_owner)
},
{
"OTEditCustomerAction", GNC_ICON_EDIT_ACCOUNT, N_("E_dit Customer"), "<primary>e",
N_("Edit the selected customer"),
G_CALLBACK (gnc_plugin_page_owner_tree_cmd_edit_owner)
},
{
"OTEditEmployeeAction", GNC_ICON_EDIT_ACCOUNT, N_("E_dit Employee"), "<primary>e",
N_("Edit the selected employee"),
G_CALLBACK (gnc_plugin_page_owner_tree_cmd_edit_owner)
},
{
"OTNewVendorAction", GNC_ICON_NEW_ACCOUNT, N_("_New Vendor…"), NULL,
N_("Create a new vendor"),
G_CALLBACK (gnc_plugin_page_owner_tree_cmd_new_owner)
},
{
"OTNewCustomerAction", GNC_ICON_NEW_ACCOUNT, N_("_New Customer…"), NULL,
N_("Create a new customer"),
G_CALLBACK (gnc_plugin_page_owner_tree_cmd_new_owner)
},
{
"OTNewEmployeeAction", GNC_ICON_NEW_ACCOUNT, N_("_New Employee…"), NULL,
N_("Create a new employee"),
G_CALLBACK (gnc_plugin_page_owner_tree_cmd_new_owner)
},
{ "OTEditVendorAction", gnc_plugin_page_owner_tree_cmd_edit_owner, NULL, NULL, NULL },
{ "OTEditCustomerAction", gnc_plugin_page_owner_tree_cmd_edit_owner, NULL, NULL, NULL },
{ "OTEditEmployeeAction", gnc_plugin_page_owner_tree_cmd_edit_owner, NULL, NULL, NULL },
{ "OTNewVendorAction", gnc_plugin_page_owner_tree_cmd_new_owner, NULL, NULL, NULL },
{ "OTNewCustomerAction", gnc_plugin_page_owner_tree_cmd_new_owner, NULL, NULL, NULL },
{ "OTNewEmployeeAction", gnc_plugin_page_owner_tree_cmd_new_owner, NULL, NULL, NULL },
#if 0 /* Disabled due to crash */
{
"EditDeleteOwnerAction", GNC_ICON_DELETE_ACCOUNT, N_("_Delete Owner…"), "Delete",
N_("Delete selected owner"),
G_CALLBACK (gnc_plugin_page_owner_tree_cmd_delete_owner)
},
{ "EditDeleteOwnerAction", gnc_plugin_page_owner_tree_cmd_delete_owner, NULL, NULL, NULL },
#endif /* Disabled due to crash */
/* View menu */
{
"ViewFilterByAction", NULL, N_("_Filter By…"), NULL, NULL,
G_CALLBACK (gnc_plugin_page_owner_tree_cmd_view_filter_by)
},
{
"ViewRefreshAction", "view-refresh", N_("_Refresh"), "<primary>r",
N_("Refresh this window"),
G_CALLBACK (gnc_plugin_page_owner_tree_cmd_refresh)
},
/* Business menu */
{
"OTNewBillAction", GNC_ICON_INVOICE_NEW, N_("New _Bill…"), NULL,
N_("Create a new bill"),
G_CALLBACK (gnc_plugin_page_owner_tree_cmd_new_invoice)
},
{
"OTNewInvoiceAction", GNC_ICON_INVOICE_NEW, N_("New _Invoice…"), NULL,
N_("Create a new invoice"),
G_CALLBACK (gnc_plugin_page_owner_tree_cmd_new_invoice)
},
{
"OTNewVoucherAction", GNC_ICON_INVOICE_NEW, N_("New _Voucher…"), NULL,
N_("Create a new voucher"),
G_CALLBACK (gnc_plugin_page_owner_tree_cmd_new_invoice)
},
{
"OTVendorListingReportAction", "document-print-preview", N_("Vendor Listing"), NULL,
N_("Show vendor aging overview for all vendors"),
G_CALLBACK (gnc_plugin_page_owner_tree_cmd_owners_report)
},
{
"OTCustomerListingReportAction", "document-print-preview", N_("Customer Listing"), NULL,
N_("Show customer aging overview for all customers"),
G_CALLBACK (gnc_plugin_page_owner_tree_cmd_owners_report)
},
{
"OTVendorReportAction", NULL, N_("Vendor Report"), NULL,
N_("Show vendor report"),
G_CALLBACK (gnc_plugin_page_owner_tree_cmd_owner_report)
},
{
"OTCustomerReportAction", NULL, N_("Customer Report"), NULL,
N_("Show customer report"),
G_CALLBACK (gnc_plugin_page_owner_tree_cmd_owner_report)
},
{
"OTEmployeeReportAction", NULL, N_("Employee Report"), NULL,
N_("Show employee report"),
G_CALLBACK (gnc_plugin_page_owner_tree_cmd_owner_report)
},
{
"OTProcessPaymentAction", GNC_ICON_INVOICE_PAY,
N_("Process Payment"), NULL, N_("Process Payment"),
G_CALLBACK (gnc_plugin_page_owner_tree_cmd_process_payment)
},
{ "ViewFilterByAction", gnc_plugin_page_owner_tree_cmd_view_filter_by, NULL, NULL, NULL },
{ "ViewRefreshAction", gnc_plugin_page_owner_tree_cmd_refresh, NULL, NULL, NULL },
{ "EditTaxOptionsAction", gnc_plugin_page_owner_tree_cmd_edit_tax, NULL, NULL, NULL },
{ "OTNewBillAction", gnc_plugin_page_owner_tree_cmd_new_invoice, NULL, NULL, NULL },
{ "OTNewInvoiceAction", gnc_plugin_page_owner_tree_cmd_new_invoice, NULL, NULL, NULL },
{ "OTNewVoucherAction", gnc_plugin_page_owner_tree_cmd_new_invoice, NULL, NULL, NULL },
{ "OTVendorListingReportAction", gnc_plugin_page_owner_tree_cmd_owners_report, NULL, NULL, NULL },
{ "OTCustomerListingReportAction", gnc_plugin_page_owner_tree_cmd_owners_report, NULL, NULL, NULL },
{ "OTVendorReportAction", gnc_plugin_page_owner_tree_cmd_owner_report, NULL, NULL, NULL },
{ "OTCustomerReportAction", gnc_plugin_page_owner_tree_cmd_owner_report, NULL, NULL, NULL },
{ "OTEmployeeReportAction", gnc_plugin_page_owner_tree_cmd_owner_report, NULL, NULL, NULL },
{ "OTProcessPaymentAction", gnc_plugin_page_owner_tree_cmd_process_payment, NULL, NULL, NULL },
};
/** The number of actions provided by this plugin. */
static guint gnc_plugin_page_owner_tree_n_actions = G_N_ELEMENTS (gnc_plugin_page_owner_tree_actions);
static guint gnc_plugin_page_owner_tree_n_actions = G_N_ELEMENTS(gnc_plugin_page_owner_tree_actions);
/** The default menu items that need to be add to the menu */
static const gchar *gnc_plugin_load_ui_items [] =
{
"FilePlaceholder3",
"EditPlaceholder2",
"EditPlaceholder3",
"EditPlaceholder5",
"ViewPlaceholder1",
"ViewPlaceholder4",
"ReportsPlaceholder1",
NULL,
};
/** Actions that require an owner to be selected before they are
* enabled. These ones are only sensitive in a read-write book. */
@ -282,7 +218,7 @@ static const gchar* readonly_inactive_actions[] =
/** Short labels for use on the toolbar buttons. */
static action_toolbar_labels toolbar_labels[] =
static GncToolBarShortNames toolbar_labels[] =
{
{ "OTEditVendorAction", N_("Edit") },
{ "OTEditCustomerAction", N_("Edit") },
@ -334,13 +270,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);
@ -364,16 +298,6 @@ gnc_plugin_page_owner_tree_new (GncOwnerType owner_type)
priv = GNC_PLUGIN_PAGE_OWNER_TREE_GET_PRIVATE(plugin_page);
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));
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);
}
LEAVE("new %s tree page %p", gncOwnerTypeToQofIdType(owner_type), plugin_page);
return GNC_PLUGIN_PAGE(plugin_page);
}
@ -390,6 +314,25 @@ gnc_plugin_page_owner_focus_widget (GncPluginPage *owner_plugin_page)
GncPluginPageOwnerTreePrivate *priv = GNC_PLUGIN_PAGE_OWNER_TREE_GET_PRIVATE(owner_plugin_page);
GtkTreeView *tree_view = priv->tree_view;
/* Disable the Transaction Menu */
GAction *action = gnc_main_window_find_action (GNC_MAIN_WINDOW(owner_plugin_page->window), "TransactionAction");
g_simple_action_set_enabled (G_SIMPLE_ACTION(action), FALSE);
/* Disable the Schedule menu */
action = gnc_main_window_find_action (GNC_MAIN_WINDOW(owner_plugin_page->window), "ScheduledAction");
g_simple_action_set_enabled (G_SIMPLE_ACTION(action), FALSE);
/* Disable the FilePrintAction */
action = gnc_main_window_find_action (GNC_MAIN_WINDOW(owner_plugin_page->window), "FilePrintAction");
g_simple_action_set_enabled (G_SIMPLE_ACTION(action), FALSE);
set_menu_and_toolbar_qualifier (owner_plugin_page);
gnc_main_window_update_menu_and_toolbar (GNC_MAIN_WINDOW(owner_plugin_page->window),
owner_plugin_page,
gnc_plugin_load_ui_items);
// setup any short toolbar names
gnc_main_window_init_short_names (GNC_MAIN_WINDOW(owner_plugin_page->window), toolbar_labels);
if (GTK_IS_TREE_VIEW(tree_view))
{
if (!gtk_widget_is_focus (GTK_WIDGET(tree_view)))
@ -431,7 +374,7 @@ 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;
@ -442,32 +385,27 @@ gnc_plugin_page_owner_tree_init (GncPluginPageOwnerTree *plugin_page)
parent = GNC_PLUGIN_PAGE(plugin_page);
g_object_set(G_OBJECT(plugin_page),
"page-name", _("Owners"),
"page-uri", "default:",
"ui-description", "gnc-plugin-page-owner-tree-ui.xml",
"ui-description", "gnc-plugin-page-owner-tree.ui",
NULL);
g_signal_connect (G_OBJECT (plugin_page), "selected",
G_CALLBACK (gnc_plugin_page_owner_tree_selected), plugin_page);
/* 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 */
action_group =
gnc_plugin_page_create_action_group(parent,
"GncPluginPageOwnerTreeActions");
gtk_action_group_add_actions(action_group,
gnc_plugin_page_owner_tree_actions,
gnc_plugin_page_owner_tree_n_actions,
plugin_page);
gnc_plugin_init_short_names (action_group, toolbar_labels);
simple_action_group = gnc_plugin_page_create_action_group (parent, "GncPluginPageOwnerTreeActions");
g_action_map_add_action_entries (G_ACTION_MAP(simple_action_group),
gnc_plugin_page_owner_tree_actions,
gnc_plugin_page_owner_tree_n_actions,
plugin_page);
/* Init filter */
priv->fd.show_inactive = TRUE;
priv->fd.show_zero_total = TRUE;
LEAVE("page %p, priv %p, action group %p",
plugin_page, priv, action_group);
plugin_page, priv, simple_action_group);
}
static void
@ -486,9 +424,10 @@ gnc_plugin_page_owner_tree_finalize (GObject *object)
LEAVE(" ");
}
static void update_inactive_actions(GncPluginPage *plugin_page)
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.
@ -496,12 +435,32 @@ 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_group (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,
"sensitive", is_sensitive);
gnc_plugin_set_actions_enabled (G_ACTION_MAP(simple_action_group), readonly_inactive_actions,
is_sensitive);
}
static void
set_menu_and_toolbar_qualifier (GncPluginPage *plugin_page)
{
GncPluginPageOwnerTree *page = GNC_PLUGIN_PAGE_OWNER_TREE(plugin_page);
GncPluginPageOwnerTreePrivate *priv;
g_return_if_fail (GNC_IS_PLUGIN_PAGE_OWNER_TREE(page));
priv = GNC_PLUGIN_PAGE_OWNER_TREE_GET_PRIVATE(page);
if (priv->owner_type == GNC_OWNER_CUSTOMER)
gnc_plugin_page_set_menu_qualifier (plugin_page, "c");
else if (priv->owner_type == GNC_OWNER_VENDOR)
gnc_plugin_page_set_menu_qualifier (plugin_page, "v");
else if (priv->owner_type == GNC_OWNER_EMPLOYEE)
gnc_plugin_page_set_menu_qualifier (plugin_page, "e");
else
gnc_plugin_page_set_menu_qualifier (plugin_page, NULL);
}
static void
@ -683,6 +642,8 @@ gnc_plugin_page_owner_tree_create_widget (GncPluginPage *plugin_page)
G_CALLBACK(gnc_plugin_page_inserted_cb),
NULL);
set_menu_and_toolbar_qualifier (plugin_page);
LEAVE("widget = %p", priv->widget);
return priv->widget;
}
@ -768,8 +729,8 @@ gnc_plugin_page_owner_tree_save_page (GncPluginPage *plugin_page,
* @param group_name The group name to use when restoring data. */
static GncPluginPage *
gnc_plugin_page_owner_tree_recreate_page (GtkWidget *window,
GKeyFile *key_file,
const gchar *group_name)
GKeyFile *key_file,
const gchar *group_name)
{
GncPluginPageOwnerTree *owner_page;
GncPluginPageOwnerTreePrivate *priv;
@ -840,8 +801,8 @@ static void gnc_ui_owner_edit (GtkWindow *parent, GncOwner *owner)
* registered in gnc-main-window.c. */
static gboolean
gnc_plugin_page_owner_tree_button_press_cb (GtkWidget *widget,
GdkEventButton *event,
GncPluginPage *page)
GdkEventButton *event,
GncPluginPage *page)
{
g_return_val_if_fail(GNC_IS_PLUGIN_PAGE(page), FALSE);
@ -857,19 +818,19 @@ gnc_plugin_page_owner_tree_button_press_cb (GtkWidget *widget,
}
static void
gnc_plugin_page_owner_tree_double_click_cb (GtkTreeView *treeview,
GtkTreePath *path,
GtkTreeViewColumn *col,
GncPluginPageOwnerTree *page)
gnc_plugin_page_owner_tree_double_click_cb (GtkTreeView *treeview,
GtkTreePath *path,
GtkTreeViewColumn *col,
GncPluginPageOwnerTree *page)
{
gnc_plugin_page_owner_tree_cmd_owner_report (NULL, page);
gnc_plugin_page_owner_tree_cmd_owner_report (NULL, NULL, (gpointer*)page);
}
static void
gnc_plugin_page_owner_tree_selection_changed_cb (GtkTreeSelection *selection,
GncPluginPageOwnerTree *page)
GncPluginPageOwnerTree *page)
{
GtkActionGroup *action_group;
GSimpleActionGroup *simple_action_group;
GtkTreeView *view;
GncOwner *owner = NULL;
gboolean sensitive;
@ -889,11 +850,11 @@ 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,
"sensitive", sensitive);
gnc_plugin_update_actions (action_group, actions_requiring_owner_rw,
"sensitive", sensitive && is_readwrite);
simple_action_group = gnc_plugin_page_get_action_group (GNC_PLUGIN_PAGE(page));
gnc_plugin_set_actions_enabled (G_ACTION_MAP(simple_action_group), actions_requiring_owner_always,
sensitive);
gnc_plugin_set_actions_enabled (G_ACTION_MAP(simple_action_group), actions_requiring_owner_rw,
sensitive && is_readwrite);
g_signal_emit (page, plugin_page_signals[OWNER_SELECTED], 0, owner);
}
@ -1009,8 +970,12 @@ static int build_owner_report (GncOwner *owner, Account *acc)
/************************************************************/
static void
gnc_plugin_page_owner_tree_cmd_new_owner (GtkAction *action, GncPluginPageOwnerTree *page)
gnc_plugin_page_owner_tree_cmd_new_owner (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
GncPluginPageOwnerTree *page = user_data;
GncPluginPageOwnerTreePrivate *priv;
GtkWindow *parent;
@ -1049,13 +1014,17 @@ gnc_plugin_page_owner_tree_cmd_new_owner (GtkAction *action, GncPluginPageOwnerT
}
static void
gnc_plugin_page_owner_tree_cmd_edit_owner (GtkAction *action, GncPluginPageOwnerTree *page)
gnc_plugin_page_owner_tree_cmd_edit_owner (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
GncPluginPageOwnerTree *page = user_data;
GtkWindow *parent;
GncOwner *owner = gnc_plugin_page_owner_tree_get_current_owner (page);
if (NULL == owner) return;
ENTER("action %p, page %p", action, page);
ENTER("action %p, page %p", simple, page);
parent = GTK_WINDOW (gnc_plugin_page_get_window (GNC_PLUGIN_PAGE (page)));
gnc_ui_owner_edit (parent, owner);
@ -1065,8 +1034,12 @@ gnc_plugin_page_owner_tree_cmd_edit_owner (GtkAction *action, GncPluginPageOwner
#if 0 /* Disabled due to crash */
static void
gnc_plugin_page_owner_tree_cmd_delete_owner (GtkAction *action, GncPluginPageOwnerTree *page)
gnc_plugin_page_owner_tree_cmd_delete_owner (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
GncPluginPageOwnerTree *page = user_data;
GncOwner *owner = gnc_plugin_page_owner_tree_get_current_owner (page);
gchar *owner_name;
GtkWidget *window;
@ -1135,42 +1108,66 @@ gnc_plugin_page_owner_tree_cmd_delete_owner (GtkAction *action, GncPluginPageOwn
/*********************/
static void
gnc_plugin_page_owner_tree_cmd_view_filter_by (GtkAction *action,
GncPluginPageOwnerTree *page)
gnc_plugin_page_owner_tree_cmd_view_filter_by (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
GncPluginPageOwnerTree *plugin_page = user_data;
GncPluginPageOwnerTreePrivate *priv;
g_return_if_fail(GNC_IS_PLUGIN_PAGE_OWNER_TREE(page));
ENTER("(action %p, page %p)", action, page);
g_return_if_fail(GNC_IS_PLUGIN_PAGE_OWNER_TREE(plugin_page));
ENTER("(action %p, page %p)", simple, plugin_page);
priv = GNC_PLUGIN_PAGE_OWNER_TREE_GET_PRIVATE(page);
owner_filter_dialog_create(&priv->fd, GNC_PLUGIN_PAGE(page));
priv = GNC_PLUGIN_PAGE_OWNER_TREE_GET_PRIVATE(plugin_page);
owner_filter_dialog_create(&priv->fd, GNC_PLUGIN_PAGE(plugin_page));
LEAVE(" ");
}
static void
gnc_plugin_page_owner_tree_cmd_refresh (GtkAction *action,
GncPluginPageOwnerTree *page)
gnc_plugin_page_owner_tree_cmd_refresh (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
GncPluginPageOwnerTree *plugin_page = user_data;
GncPluginPageOwnerTreePrivate *priv;
g_return_if_fail(GNC_IS_PLUGIN_PAGE_OWNER_TREE(page));
g_return_if_fail(GNC_IS_PLUGIN_PAGE_OWNER_TREE(plugin_page));
priv = GNC_PLUGIN_PAGE_OWNER_TREE_GET_PRIVATE(page);
priv = GNC_PLUGIN_PAGE_OWNER_TREE_GET_PRIVATE(plugin_page);
gtk_widget_queue_draw (priv->widget);
}
static void
gnc_plugin_page_owner_tree_cmd_new_invoice (GtkAction *action,
GncPluginPageOwnerTree *page)
gnc_plugin_page_owner_tree_cmd_edit_tax (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
GncPluginPageOwnerTree *plugin_page = user_data;
GtkWidget *parent;
g_return_if_fail (GNC_IS_PLUGIN_PAGE_OWNER_TREE(plugin_page));
parent = GTK_WIDGET(gnc_plugin_page_get_window (GNC_PLUGIN_PAGE(plugin_page)));
gnc_tax_info_dialog (parent, NULL);
}
static void
gnc_plugin_page_owner_tree_cmd_new_invoice (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
GncPluginPageOwnerTree *plugin_page = user_data;
GncPluginPageOwnerTreePrivate *priv;
GncOwner current_owner;
GtkWindow *parent;
ENTER("action %p, page %p", action, page);
ENTER("action %p, plugin_page %p", simple, plugin_page);
priv = GNC_PLUGIN_PAGE_OWNER_TREE_GET_PRIVATE(page);
priv = GNC_PLUGIN_PAGE_OWNER_TREE_GET_PRIVATE(plugin_page);
switch (priv->owner_type)
{
case GNC_OWNER_NONE :
@ -1180,30 +1177,30 @@ gnc_plugin_page_owner_tree_cmd_new_invoice (GtkAction *action,
case GNC_OWNER_CUSTOMER :
{
gncOwnerInitCustomer(&current_owner,
gncOwnerGetCustomer(gnc_plugin_page_owner_tree_get_current_owner (page)) );
gncOwnerGetCustomer(gnc_plugin_page_owner_tree_get_current_owner (plugin_page)));
break;
}
case GNC_OWNER_JOB :
{
gncOwnerInitJob(&current_owner,
gncOwnerGetJob(gnc_plugin_page_owner_tree_get_current_owner (page)) );
gncOwnerGetJob(gnc_plugin_page_owner_tree_get_current_owner (plugin_page)));
break;
}
case GNC_OWNER_VENDOR :
{
gncOwnerInitVendor(&current_owner,
gncOwnerGetVendor(gnc_plugin_page_owner_tree_get_current_owner (page)) );
gncOwnerGetVendor(gnc_plugin_page_owner_tree_get_current_owner (plugin_page)));
break;
}
case GNC_OWNER_EMPLOYEE :
{
gncOwnerInitEmployee(&current_owner,
gncOwnerGetEmployee(gnc_plugin_page_owner_tree_get_current_owner (page)) );
gncOwnerGetEmployee(gnc_plugin_page_owner_tree_get_current_owner (plugin_page)));
break;
}
}
parent = GTK_WINDOW (gnc_plugin_page_get_window (GNC_PLUGIN_PAGE (page)));
parent = GTK_WINDOW (gnc_plugin_page_get_window (GNC_PLUGIN_PAGE(plugin_page)));
if (gncOwnerGetType(&current_owner) != GNC_OWNER_UNDEFINED)
gnc_ui_invoice_new (parent, &current_owner, gnc_get_current_book ());
@ -1211,13 +1208,16 @@ gnc_plugin_page_owner_tree_cmd_new_invoice (GtkAction *action,
}
static void
gnc_plugin_page_owner_tree_cmd_owners_report (GtkAction *action,
GncPluginPageOwnerTree *plugin_page)
gnc_plugin_page_owner_tree_cmd_owners_report (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
GncPluginPageOwnerTree *plugin_page = user_data;
GncPluginPageOwnerTreePrivate *priv;
int id;
ENTER("(action %p, plugin_page %p)", action, plugin_page);
ENTER("(action %p, plugin_page %p)", simple, plugin_page);
g_return_if_fail(GNC_IS_PLUGIN_PAGE_OWNER_TREE(plugin_page));
@ -1234,13 +1234,16 @@ gnc_plugin_page_owner_tree_cmd_owners_report (GtkAction *action,
}
static void
gnc_plugin_page_owner_tree_cmd_owner_report (GtkAction *action,
GncPluginPageOwnerTree *plugin_page)
gnc_plugin_page_owner_tree_cmd_owner_report (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
GncPluginPageOwnerTree *plugin_page = user_data;
GncOwner *current_owner;
int id;
ENTER("(action %p, plugin_page %p)", action, plugin_page);
ENTER("(action %p, plugin_page %p)", simple, plugin_page);
g_return_if_fail(GNC_IS_PLUGIN_PAGE_OWNER_TREE(plugin_page));
@ -1258,10 +1261,13 @@ gnc_plugin_page_owner_tree_cmd_owner_report (GtkAction *action,
static void
gnc_plugin_page_owner_tree_cmd_process_payment (GtkAction *action,
GncPluginPageOwnerTree *plugin_page)
gnc_plugin_page_owner_tree_cmd_process_payment (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
ENTER("(action %p, plugin_page %p)", action, plugin_page);
GncPluginPageOwnerTree *plugin_page = user_data;
ENTER("(action %p, plugin_page %p)", simple, plugin_page);
g_return_if_fail(GNC_IS_PLUGIN_PAGE_OWNER_TREE(plugin_page));

File diff suppressed because it is too large Load Diff

View File

@ -61,6 +61,7 @@ extern "C"
#include "gnc-html-factory.h"
#include "gnc-file.h"
#include "gnc-filepath-utils.h"
#include "gnc-gtk-utils.h"
#include "gnc-plugin.h"
#include "gnc-plugin-page-report.h"
#include "gnc-plugin-file-history.h"
@ -126,12 +127,13 @@ typedef struct GncPluginPageReportPrivate
SCM edited_reports;
/* The page is in the process of reloading the html */
gboolean reloading;
gboolean reloading;
gboolean loaded;
/// the gnc_html abstraction this PluginPage contains
// gnc_html *html;
GncHtml *html;
gboolean webkit2;
/// the container the above HTML widget is in.
GtkContainer *container;
@ -174,19 +176,66 @@ static void gnc_plugin_page_report_option_change_cb(gpointer data);
void gnc_plugin_page_report_remove_edited_report(GncPluginPageReportPrivate *priv, SCM report);
void gnc_plugin_page_report_add_edited_report(GncPluginPageReportPrivate *priv, SCM report);
static void gnc_plugin_page_report_menu_updates (GncPluginPage *plugin_page);
void gnc_plugin_page_report_raise_editor(SCM report);
static void gnc_plugin_page_report_forw_cb(GtkAction *action, GncPluginPageReport *rep);
static void gnc_plugin_page_report_back_cb(GtkAction *action, GncPluginPageReport *rep);
static void gnc_plugin_page_report_reload_cb(GtkAction *action, GncPluginPageReport *rep);
static void gnc_plugin_page_report_stop_cb(GtkAction *action, GncPluginPageReport *rep);
static void gnc_plugin_page_report_save_cb(GtkAction *action, GncPluginPageReport *rep);
static void gnc_plugin_page_report_save_as_cb(GtkAction *action, GncPluginPageReport *rep);
static void gnc_plugin_page_report_export_cb(GtkAction *action, GncPluginPageReport *rep);
static void gnc_plugin_page_report_options_cb(GtkAction *action, GncPluginPageReport *rep);
static void gnc_plugin_page_report_print_cb(GtkAction *action, GncPluginPageReport *rep);
static void gnc_plugin_page_report_exportpdf_cb(GtkAction *action, GncPluginPageReport *rep);
static void gnc_plugin_page_report_copy_cb(GtkAction *action, GncPluginPageReport *rep);
static void gnc_plugin_page_report_forw_cb (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
static void gnc_plugin_page_report_back_cb (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
static void gnc_plugin_page_report_reload_cb (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
static void gnc_plugin_page_report_stop_cb (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
static void gnc_plugin_page_report_save_cb (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
static void gnc_plugin_page_report_save_as_cb (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
static void gnc_plugin_page_report_export_cb (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
static void gnc_plugin_page_report_options_cb (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
static void gnc_plugin_page_report_print_cb (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
static void gnc_plugin_page_report_exportpdf_cb (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
static void gnc_plugin_page_report_copy_cb (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
static void gnc_plugin_page_report_edit_tax_cb (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
static GActionEntry report_actions[] =
{
{ "FilePrintAction", gnc_plugin_page_report_print_cb, nullptr, nullptr, nullptr },
{ "FilePrintPDFAction", gnc_plugin_page_report_exportpdf_cb, nullptr, nullptr, nullptr },
{ "EditCopyAction", gnc_plugin_page_report_copy_cb, nullptr, nullptr, nullptr },
{ "EditTaxOptionsAction", gnc_plugin_page_report_edit_tax_cb, nullptr, nullptr, nullptr },
{ "ViewRefreshAction", gnc_plugin_page_report_reload_cb, nullptr, nullptr, nullptr },
{ "ReportSaveAction", gnc_plugin_page_report_save_cb, nullptr, nullptr, nullptr },
{ "ReportSaveAsAction", gnc_plugin_page_report_save_as_cb, nullptr, nullptr, nullptr },
{ "ReportExportAction", gnc_plugin_page_report_export_cb, nullptr, nullptr, nullptr },
{ "ReportOptionsAction", gnc_plugin_page_report_options_cb, nullptr, nullptr, nullptr },
{ "ReportBackAction", gnc_plugin_page_report_back_cb, nullptr, nullptr, nullptr },
{ "ReportForwAction", gnc_plugin_page_report_forw_cb, nullptr, nullptr, nullptr },
{ "ReportReloadAction", gnc_plugin_page_report_reload_cb, nullptr, nullptr, nullptr },
{ "ReportStopAction", gnc_plugin_page_report_stop_cb, nullptr, nullptr, nullptr },
};
static guint num_report_actions = G_N_ELEMENTS(report_actions);
/** The default menu items that need to be add to the menu */
static const gchar *gnc_plugin_load_ui_items [] =
{
"FilePlaceholder3",
"FilePlaceholder4",
"FilePlaceholder5",
"EditPlaceholder6",
"ReportsPlaceholder1",
NULL,
};
/** Short labels for use on the toolbar buttons. */
static GncToolBarShortNames toolbar_labels[] =
{
{ "FilePrintAction", N_("Print") },
{ "ReportExportAction", N_("Export") },
{ "ReportOptionsAction", N_("Options") },
/* Translators: This string is meant to be a short alternative for "Save Report Configuration"
to be used as toolbar button label. */
{ "ReportSaveAction", N_("Save Config") },
/* Translators: This string is meant to be a short alternative for "Save Report Configuration As..."
to be used as toolbar button label. */
{ "ReportSaveAsAction", N_("Save Config As...") },
{ "FilePrintPDFAction", N_("Make Pdf") },
{ nullptr, nullptr },
};
static void
gnc_plugin_page_report_get_property( GObject *obj,
@ -249,10 +298,27 @@ gnc_plugin_page_report_focus_widget (GncPluginPage *report_plugin_page)
{
GncPluginPageReportPrivate *priv = GNC_PLUGIN_PAGE_REPORT_GET_PRIVATE(report_plugin_page);
GtkWidget *window;
GAction *action;
if (!priv)
return FALSE;
/* Disable the Transaction Menu */
action = gnc_main_window_find_action (GNC_MAIN_WINDOW(report_plugin_page->window), "TransactionAction");
g_simple_action_set_enabled (G_SIMPLE_ACTION(action), FALSE);
/* Disable the Schedule menu */
action = gnc_main_window_find_action (GNC_MAIN_WINDOW(report_plugin_page->window), "ScheduledAction");
g_simple_action_set_enabled (G_SIMPLE_ACTION(action), FALSE);
gnc_main_window_update_menu_and_toolbar (GNC_MAIN_WINDOW(report_plugin_page->window),
report_plugin_page,
gnc_plugin_load_ui_items);
// setup any short toolbar names
gnc_main_window_init_short_names (GNC_MAIN_WINDOW(report_plugin_page->window), toolbar_labels);
gnc_plugin_page_report_menu_updates (report_plugin_page);
window = gnc_plugin_page_get_window (report_plugin_page);
if (window && !gnc_main_window_is_restoring_pages (GNC_MAIN_WINDOW(window)))
@ -433,7 +499,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;
@ -443,16 +509,14 @@ gnc_plugin_page_report_create_widget( GncPluginPage *page )
ENTER("page %p", 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);
#endif
report = GNC_PLUGIN_PAGE_REPORT(page);
priv = GNC_PLUGIN_PAGE_REPORT_GET_PRIVATE(report);
#ifndef WEBKIT1
/* Hide the ExportPdf action for Webkit2 */
priv->webkit2 = TRUE;
#endif
topLvl = gnc_ui_get_main_window (nullptr);
// priv->html = gnc_html_new( topLvl );
priv->html = gnc_html_factory_create_html();
@ -580,10 +644,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;
@ -734,7 +797,7 @@ gnc_plugin_page_report_option_change_cb(gpointer data)
gnc_utf8_strip_invalid_and_controls(new_name);
ENTER("Cleaned-up new report name: %s", new_name);
main_window_update_page_name(GNC_PLUGIN_PAGE(report), new_name);
}
}
g_free(new_name);
/* it's probably already dirty, but make sure */
@ -1055,17 +1118,15 @@ 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;
GncMainWindow *window = (GncMainWindow*)gnc_plugin_page_get_window (GNC_PLUGIN_PAGE(page));
GAction *action;
action = gnc_plugin_page_get_action (page, "EditCopyAction");
gtk_action_set_sensitive (action, TRUE);
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);
action = gnc_plugin_page_get_action (page, "EditPasteAction");
gtk_action_set_sensitive (action, FALSE);
gtk_action_set_visible (action, !hide);
action = gnc_main_window_find_action (window, "EditCopyAction");
g_simple_action_set_enabled (G_SIMPLE_ACTION(action), TRUE);
action = gnc_main_window_find_action (window, "EditCutAction");
g_simple_action_set_enabled (G_SIMPLE_ACTION(action), FALSE);
action = gnc_main_window_find_action (window, "EditPasteAction");
g_simple_action_set_enabled (G_SIMPLE_ACTION(action), FALSE);
}
static gboolean
@ -1124,22 +1185,6 @@ gnc_plugin_page_report_destroy(GncPluginPageReportPrivate * priv)
scm_gc_unprotect_object(priv->edited_reports);
}
/** Short labels for use on the toolbar buttons. */
static action_toolbar_labels toolbar_labels[] =
{
{ "FilePrintAction", N_("Print") },
{ "ReportExportAction", N_("Export") },
{ "ReportOptionsAction", N_("Options") },
/* Translators: This string is meant to be a short alternative for "Save Report Configuration"
to be used as toolbar button label. */
{ "ReportSaveAction", N_("Save Config") },
/* Translators: This string is meant to be a short alternative for "Save Report Configuration As…"
to be used as toolbar button label. */
{ "ReportSaveAsAction", N_("Save Config As…") },
{ "FilePrintPDFAction", N_("Make Pdf") },
{ nullptr, nullptr },
};
static const gchar *initially_insensitive_actions[] =
{
nullptr
@ -1178,13 +1223,40 @@ gnc_plugin_page_report_constructor(GType this_type, guint n_properties, GObjectC
}
static void
gnc_plugin_page_report_constr_init(GncPluginPageReport *plugin_page, gint reportId)
gnc_plugin_page_report_menu_update (GncPluginPage *plugin_page,
action_toolbar_labels *tooltip_list)
{
GncMainWindow *window = GNC_MAIN_WINDOW(GNC_PLUGIN_PAGE(plugin_page)->window);
GtkWidget *tool_item;
for (gint i = 0; (tooltip_list[i].action_name != nullptr); i++)
{
gboolean found = gnc_main_window_update_menu_for_action (window,
tooltip_list[i].action_name,
_(tooltip_list[i].label),
_(tooltip_list[i].tooltip));
tool_item = gnc_main_window_toolbar_find_tool_item (window,
tooltip_list[i].action_name);
if (tool_item)
{ // only need to update the tooltip here
gtk_widget_set_tooltip_text (GTK_WIDGET(tool_item), _(tooltip_list[i].tooltip));
g_object_set (G_OBJECT(tool_item), "has-tooltip", false, nullptr);
}
}
// need to add the accelerator keys for the updated menu items
gnc_main_window_menu_add_accelerator_keys (window);
}
static void
gnc_plugin_page_report_menu_updates (GncPluginPage *plugin_page)
{
GncPluginPageReportPrivate *priv;
GtkActionGroup *action_group;
GncPluginPage *parent;
gboolean use_new;
gchar *name;
GncPluginPageReport *report;
GncMainWindow *window;
action_toolbar_labels tooltip_list[3];
GAction *action;
gchar *saved_reports_path = gnc_build_userdata_path (SAVED_REPORTS_FILE);
gchar *report_save_str = g_strdup_printf (
_("Update the current report's saved configuration. "
@ -1193,118 +1265,70 @@ gnc_plugin_page_report_constr_init(GncPluginPageReport *plugin_page, gint report
_("Add the current report's configuration to the 'Reports->Saved Report Configurations' menu. "
"The report configuration will be saved in the file %s."), saved_reports_path);
GtkActionEntry report_actions[] =
report = GNC_PLUGIN_PAGE_REPORT(plugin_page);
priv = GNC_PLUGIN_PAGE_REPORT_GET_PRIVATE(report);
window = (GncMainWindow*)gnc_plugin_page_get_window (GNC_PLUGIN_PAGE(plugin_page));
tooltip_list[0] = { "ReportSaveAction", N_("Save _Report Configuration"), report_save_str };
tooltip_list[1] = { "ReportSaveAsAction", N_("Save Report Configuration As..."), report_saveas_str };
tooltip_list[2] = { nullptr, nullptr, nullptr };
gnc_plugin_page_report_menu_update (plugin_page, tooltip_list);
/* Enable the FilePrintAction */
action = gnc_main_window_find_action (window, "FilePrintAction");
g_simple_action_set_enabled (G_SIMPLE_ACTION(action), true);
if (priv->webkit2)
{
{
"FilePrintAction", "document-print", N_("_Print Report…"), "<primary>p",
N_("Print the current report"),
G_CALLBACK(gnc_plugin_page_report_print_cb)
},
{
"FilePrintPDFAction", GNC_ICON_PDF_EXPORT, N_("Export as P_DF…"), nullptr,
N_("Export the current report as a PDF document"),
G_CALLBACK(gnc_plugin_page_report_exportpdf_cb)
},
GtkWidget *pdf_item = gnc_main_window_menu_find_menu_item (window, "FilePrintPDFAction");
gtk_widget_hide (pdf_item);
}
g_free (saved_reports_path);
g_free (report_save_str);
g_free (report_saveas_str);
}
{
"EditCutAction", "edit-cut", N_("Cu_t"), "<primary>X",
N_("Cut the current selection and copy it to clipboard"),
nullptr
},
{
"EditCopyAction", "edit-copy", N_("_Copy"), "<primary>C",
N_("Copy the current selection to clipboard"),
G_CALLBACK(gnc_plugin_page_report_copy_cb)
},
{
"EditPasteAction", "edit-paste", N_("_Paste"), "<primary>V",
N_("Paste the clipboard content at the cursor position"),
nullptr
},
{
"ViewRefreshAction", "view-refresh", N_("_Refresh"), "<primary>r",
N_("Refresh this window"),
G_CALLBACK (gnc_plugin_page_report_reload_cb)
},
{
"ReportSaveAction", "document-save", N_("Save _Report Configuration"), "<primary><alt>s",
report_save_str, G_CALLBACK(gnc_plugin_page_report_save_cb)
},
{
"ReportSaveAsAction", "document-save-as", N_("Save Report Configuration As…"), "<primary><alt><shift>s",
report_saveas_str, G_CALLBACK(gnc_plugin_page_report_save_as_cb)
},
{
"ReportExportAction", "go-next", N_("Export _Report"), nullptr,
N_("Export HTML-formatted report to file"),
G_CALLBACK(gnc_plugin_page_report_export_cb)
},
{
"ReportOptionsAction", "document-properties", N_("_Report Options"), nullptr,
N_("Edit report options"),
G_CALLBACK(gnc_plugin_page_report_options_cb)
},
static void
gnc_plugin_page_report_constr_init (GncPluginPageReport *plugin_page, gint reportId)
{
GncPluginPageReportPrivate *priv;
GSimpleActionGroup *simple_action_group;
GncPluginPage *parent;
gboolean use_new;
gchar *name;
{
"ReportBackAction", "go-previous", N_("Back"), nullptr,
N_("Move back one step in the history"),
G_CALLBACK(gnc_plugin_page_report_back_cb)
},
{
"ReportForwAction", "go-next", N_("Forward"), nullptr,
N_("Move forward one step in the history"),
G_CALLBACK(gnc_plugin_page_report_forw_cb)
},
{
"ReportReloadAction", "view-refresh", N_("Reload"), nullptr,
N_("Reload the current page"),
G_CALLBACK(gnc_plugin_page_report_reload_cb)
},
{
"ReportStopAction", "process-stop", N_("Stop"), nullptr,
N_("Cancel outstanding HTML requests"),
G_CALLBACK(gnc_plugin_page_report_stop_cb)
},
};
guint num_report_actions = G_N_ELEMENTS( report_actions );
DEBUG( "property reportId=%d", reportId );
DEBUG("property reportId=%d", reportId);
priv = GNC_PLUGIN_PAGE_REPORT_GET_PRIVATE(plugin_page);
priv->reportId = reportId;
priv->webkit2 = FALSE;
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.xml",
"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,
"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 */
action_group =
gnc_plugin_page_create_action_group(parent,
"GncPluginPageReportActions");
gtk_action_group_add_actions( action_group,
report_actions,
num_report_actions,
plugin_page );
gnc_plugin_update_actions(action_group,
initially_insensitive_actions,
"sensitive", FALSE);
gnc_plugin_init_short_names (action_group, toolbar_labels);
simple_action_group = gnc_plugin_page_create_action_group (parent, "GncPluginPageReportActions");
g_action_map_add_action_entries (G_ACTION_MAP(simple_action_group),
report_actions,
num_report_actions,
plugin_page);
g_free (saved_reports_path);
g_free (report_save_str);
g_free (report_saveas_str);
gnc_plugin_set_actions_enabled (G_ACTION_MAP(simple_action_group), initially_insensitive_actions,
FALSE);
}
GncPluginPage*
@ -1362,31 +1386,32 @@ 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;
act = gnc_plugin_page_get_action(GNC_PLUGIN_PAGE(report),
"ReportForwAction" );
gtk_action_set_sensitive(act, enabled);
GAction *action = gnc_plugin_page_get_action (GNC_PLUGIN_PAGE(report),
"ReportForwAction");
if (action != NULL)
g_simple_action_set_enabled (G_SIMPLE_ACTION(action), 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;
act = gnc_plugin_page_get_action(GNC_PLUGIN_PAGE(report),
"ReportBackAction" );
gtk_action_set_sensitive(act, enabled);
GAction *action = gnc_plugin_page_get_action (GNC_PLUGIN_PAGE(report),
"ReportBackAction");
if (action != NULL)
g_simple_action_set_enabled (G_SIMPLE_ACTION(action), enabled);
}
// ------------------------------------------------------------
// GTK ACTION CALLBACKS
static void
gnc_plugin_page_report_forw_cb( GtkAction *action, GncPluginPageReport *report )
gnc_plugin_page_report_forw_cb (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
GncPluginPageReport *report = (GncPluginPageReport*)user_data;
GncPluginPageReportPrivate *priv;
gnc_html_history_node * node = nullptr;
@ -1402,8 +1427,11 @@ gnc_plugin_page_report_forw_cb( GtkAction *action, GncPluginPageReport *report )
}
static void
gnc_plugin_page_report_back_cb( GtkAction *action, GncPluginPageReport *report )
gnc_plugin_page_report_back_cb (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
GncPluginPageReport *report = (GncPluginPageReport*)user_data;
GncPluginPageReportPrivate *priv;
gnc_html_history_node * node;
@ -1421,12 +1449,15 @@ gnc_plugin_page_report_back_cb( GtkAction *action, GncPluginPageReport *report )
void
gnc_plugin_page_report_reload (GncPluginPageReport *report)
{
gnc_plugin_page_report_reload_cb (NULL, report);
gnc_plugin_page_report_reload_cb (nullptr, nullptr, report);
}
static void
gnc_plugin_page_report_reload_cb( GtkAction *action, GncPluginPageReport *report )
gnc_plugin_page_report_reload_cb (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
GncPluginPageReport *report = (GncPluginPageReport*)user_data;
GncPluginPage *page;
GncPluginPageReportPrivate *priv;
SCM dirty_report;
@ -1461,8 +1492,11 @@ gnc_plugin_page_report_reload_cb( GtkAction *action, GncPluginPageReport *report
}
static void
gnc_plugin_page_report_stop_cb( GtkAction *action, GncPluginPageReport *report )
gnc_plugin_page_report_stop_cb (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
GncPluginPageReport *report = (GncPluginPageReport*)user_data;
GncPluginPageReportPrivate *priv;
priv = GNC_PLUGIN_PAGE_REPORT_GET_PRIVATE(report);
@ -1618,8 +1652,23 @@ gnc_get_export_filename (SCM choice, GtkWindow *parent)
}
static void
gnc_plugin_page_report_save_as_cb( GtkAction *action, GncPluginPageReport *report )
gnc_plugin_page_report_edit_tax_cb (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
GncPluginPageReport *report = (GncPluginPageReport*)user_data;
GtkWidget *window;
window = GNC_PLUGIN_PAGE(report)->window;
gnc_tax_info_dialog (window, nullptr);
}
static void
gnc_plugin_page_report_save_as_cb (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
GncPluginPageReport *report = (GncPluginPageReport*)user_data;
GncPluginPageReportPrivate *priv;
SCM save_func;
SCM rpt_id;
@ -1649,8 +1698,11 @@ gnc_plugin_page_report_save_as_cb( GtkAction *action, GncPluginPageReport *repor
}
static void
gnc_plugin_page_report_save_cb( GtkAction *action, GncPluginPageReport *report )
gnc_plugin_page_report_save_cb (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
GncPluginPageReport *report = (GncPluginPageReport*)user_data;
GncPluginPageReportPrivate *priv;
SCM check_func, save_func;
SCM rpt_id;
@ -1675,13 +1727,16 @@ gnc_plugin_page_report_save_cb( GtkAction *action, GncPluginPageReport *report )
* So let's create a new report template based on this report
* and allow the user to change the name.
*/
gnc_plugin_page_report_save_as_cb (action, report);
gnc_plugin_page_report_save_as_cb (simple, parameter, report);
}
}
static void
gnc_plugin_page_report_export_cb( GtkAction *action, GncPluginPageReport *report )
gnc_plugin_page_report_export_cb (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
GncPluginPageReport *report = (GncPluginPageReport*)user_data;
GncPluginPageReportPrivate *priv;
char * filepath;
SCM export_types;
@ -1745,10 +1800,10 @@ gnc_plugin_page_report_export_cb( GtkAction *action, GncPluginPageReport *report
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;
}
@ -1768,8 +1823,11 @@ gnc_plugin_page_report_export_cb( GtkAction *action, GncPluginPageReport *report
}
static void
gnc_plugin_page_report_options_cb( GtkAction *action, GncPluginPageReport *report )
gnc_plugin_page_report_options_cb (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
GncPluginPageReport *report = (GncPluginPageReport*)user_data;
GncPluginPageReportPrivate *priv;
GtkWindow *parent = GTK_WINDOW (gnc_plugin_page_get_window (GNC_PLUGIN_PAGE (report)));
priv = GNC_PLUGIN_PAGE_REPORT_GET_PRIVATE(report);
@ -1934,8 +1992,11 @@ static gchar *report_create_jobname(GncPluginPageReportPrivate *priv)
}
static void
gnc_plugin_page_report_print_cb( GtkAction *action, GncPluginPageReport *report )
gnc_plugin_page_report_print_cb (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
GncPluginPageReport *report = (GncPluginPageReport*)user_data;
GncPluginPageReportPrivate *priv = GNC_PLUGIN_PAGE_REPORT_GET_PRIVATE(report);
gchar *job_name = report_create_jobname(priv);
@ -1951,8 +2012,11 @@ gnc_plugin_page_report_print_cb( GtkAction *action, GncPluginPageReport *report
}
static void
gnc_plugin_page_report_exportpdf_cb( GtkAction *action, GncPluginPageReport *report )
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);
gchar *job_name = report_create_jobname(priv);
GncInvoice *invoice;
@ -1966,19 +2030,19 @@ gnc_plugin_page_report_exportpdf_cb( GtkAction *action, GncPluginPageReport *rep
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,
(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;
}
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;
}
}
}
@ -1992,35 +2056,36 @@ gnc_plugin_page_report_exportpdf_cb( GtkAction *action, GncPluginPageReport *rep
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);
}
static void
gnc_plugin_page_report_copy_cb(GtkAction *action, GncPluginPageReport *report)
gnc_plugin_page_report_copy_cb (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
GncPluginPageReport *report = (GncPluginPageReport*)user_data;
GncPluginPageReportPrivate *priv;
priv = GNC_PLUGIN_PAGE_REPORT_GET_PRIVATE(report);

View File

@ -62,6 +62,7 @@
#include "gnc-glib-utils.h"
#include "gnc-icons.h"
#include "gnc-main-window.h"
#include "gnc-plugin.h"
#include "gnc-plugin-page-sx-list.h"
#include "gnc-session.h"
#include "gnc-sx-instance-dense-cal-adapter.h"
@ -119,38 +120,37 @@ static GncPluginPage *gnc_plugin_page_sx_list_recreate_page (GtkWidget *window,
static void gppsl_row_activated_cb (GtkTreeView *tree_view, GtkTreePath *path, GtkTreeViewColumn *column, gpointer user_data);
static void gnc_plugin_page_sx_list_cmd_new (GtkAction *action, GncPluginPageSxList *page);
static void gnc_plugin_page_sx_list_cmd_edit (GtkAction *action, GncPluginPageSxList *page);
static void gnc_plugin_page_sx_list_cmd_delete (GtkAction *action, GncPluginPageSxList *page);
static void gnc_plugin_page_sx_list_cmd_refresh (GtkAction *action, GncPluginPageSxList *page);
static void gnc_plugin_page_sx_list_cmd_new (GSimpleAction *simple, GVariant *paramter, gpointer user_data);
static void gnc_plugin_page_sx_list_cmd_edit (GSimpleAction *simple, GVariant *paramter, gpointer user_data);
static void gnc_plugin_page_sx_list_cmd_delete (GSimpleAction *simple, GVariant *paramter, gpointer user_data);
static void gnc_plugin_page_sx_list_cmd_refresh (GSimpleAction *simple, GVariant *paramter, gpointer user_data);
static void gnc_plugin_page_sx_list_cmd_edit_tax_options (GSimpleAction *simple, GVariant *paramter, gpointer user_data);
/* Command callbacks */
static GtkActionEntry gnc_plugin_page_sx_list_actions [] =
static GActionEntry gnc_plugin_page_sx_list_actions [] =
{
{ "SxListAction", NULL, N_("_Scheduled"), NULL, NULL, NULL },
{
"SxListNewAction", GNC_ICON_NEW_ACCOUNT, N_("_New"), NULL,
N_("Create a new scheduled transaction"), G_CALLBACK(gnc_plugin_page_sx_list_cmd_new)
},
{
"SxListEditAction", GNC_ICON_EDIT_ACCOUNT, N_("_Edit"), NULL,
N_("Edit the selected scheduled transaction"), G_CALLBACK(gnc_plugin_page_sx_list_cmd_edit)
},
{
"SxListDeleteAction", GNC_ICON_DELETE_ACCOUNT, N_("_Delete"), NULL,
N_("Delete the selected scheduled transaction"), G_CALLBACK(gnc_plugin_page_sx_list_cmd_delete)
},
/* View menu */
{
"ViewRefreshAction", "view-refresh", N_("_Refresh"), "<primary>r",
N_("Refresh this window"), G_CALLBACK(gnc_plugin_page_sx_list_cmd_refresh)
},
{ "SxListAction", NULL, NULL, NULL, NULL },
{ "SxListNewAction", gnc_plugin_page_sx_list_cmd_new, NULL, NULL, NULL },
{ "SxListEditAction", gnc_plugin_page_sx_list_cmd_edit, NULL, NULL, NULL },
{ "SxListDeleteAction", gnc_plugin_page_sx_list_cmd_delete, NULL, NULL, NULL },
{ "ViewRefreshAction", gnc_plugin_page_sx_list_cmd_refresh, NULL, NULL, NULL },
{ "EditTaxOptionsAction", gnc_plugin_page_sx_list_cmd_edit_tax_options, NULL, NULL, NULL },
};
/** The number of actions provided by this plugin. */
static guint gnc_plugin_page_sx_list_n_actions = G_N_ELEMENTS(gnc_plugin_page_sx_list_actions);
/** The default menu items that need to be add to the menu */
static const gchar *gnc_plugin_load_ui_items [] =
{
"FilePlaceholder3",
"EditPlaceholder3",
"EditPlaceholder5",
"ViewPlaceholder4",
"SchedulePlaceholder0",
NULL,
};
GncPluginPage *
gnc_plugin_page_sx_list_new (void)
{
@ -178,6 +178,20 @@ gnc_plugin_page_sx_list_focus_widget (GncPluginPage *sx_plugin_page)
GncPluginPageSxListPrivate *priv = GNC_PLUGIN_PAGE_SX_LIST_GET_PRIVATE(sx_plugin_page);
GtkTreeView *tree_view = priv->tree_view;
/* Disable the Transaction Menu */
GAction *action = gnc_main_window_find_action (GNC_MAIN_WINDOW(sx_plugin_page->window), "TransactionAction");
g_simple_action_set_enabled (G_SIMPLE_ACTION(action), FALSE);
/* Enable the Schedule Menu */
action = gnc_main_window_find_action (GNC_MAIN_WINDOW(sx_plugin_page->window), "ScheduledAction");
g_simple_action_set_enabled (G_SIMPLE_ACTION(action), TRUE);
/* Disable the FilePrintAction */
action = gnc_main_window_find_action (GNC_MAIN_WINDOW(sx_plugin_page->window), "FilePrintAction");
g_simple_action_set_enabled (G_SIMPLE_ACTION(action), FALSE);
gnc_main_window_update_menu_and_toolbar (GNC_MAIN_WINDOW(sx_plugin_page->window),
sx_plugin_page,
gnc_plugin_load_ui_items);
if (GTK_IS_TREE_VIEW(tree_view))
{
if (!gtk_widget_is_focus (GTK_WIDGET(tree_view)))
@ -211,26 +225,22 @@ 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;
/* Init parent declared variables */
parent = GNC_PLUGIN_PAGE(plugin_page);
g_object_set(G_OBJECT(plugin_page),
"page-name", _("Scheduled Transactions"),
"page-uri", "default:",
"ui-description", "gnc-plugin-page-sx-list-ui.xml",
"ui-description", "gnc-plugin-page-sx-list.ui",
NULL);
gnc_plugin_page_add_book (parent, gnc_get_current_book());
action_group =
gnc_plugin_page_create_action_group (parent,
"GncPluginPageSxListActions");
gtk_action_group_add_actions (action_group,
gnc_plugin_page_sx_list_actions,
gnc_plugin_page_sx_list_n_actions,
plugin_page);
/* gnc_plugin_init_short_names (action_group, toolbar_labels); */
simple_action_group = gnc_plugin_page_create_action_group (parent, "GncPluginPageSxListActions");
g_action_map_add_action_entries (G_ACTION_MAP(simple_action_group),
gnc_plugin_page_sx_list_actions,
gnc_plugin_page_sx_list_n_actions,
plugin_page);
}
@ -304,18 +314,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);
}
@ -376,26 +385,6 @@ gppsl_model_populated_cb (GtkTreeModel *tree_model, GncPluginPageSxList *page)
}
}
static void
gpps_new_cb (GtkMenuItem *menuitem, GncPluginPageSxList *page)
{
gnc_plugin_page_sx_list_cmd_new (NULL, page);
return;
}
static void
gpps_edit_cb (GtkMenuItem *menuitem, GncPluginPageSxList *page)
{
gnc_plugin_page_sx_list_cmd_edit (NULL, page);
return;
}
static void
gpps_delete_cb (GtkMenuItem *menuitem, GncPluginPageSxList *page)
{
gnc_plugin_page_sx_list_cmd_delete (NULL, page);
return;
}
static void
treeview_popup (GtkTreeView *treeview, GdkEvent *event, GncPluginPageSxList *page)
@ -405,21 +394,27 @@ treeview_popup (GtkTreeView *treeview, GdkEvent *event, GncPluginPageSxList *pag
GtkTreeSelection *selection = gtk_tree_view_get_selection (tree_view);
gint count_selection = gtk_tree_selection_count_selected_rows (selection);
GtkWidget *menu, *menuitem;
gchar *full_action_name;
const gchar *group_name = gnc_plugin_page_get_simple_action_group_name (GNC_PLUGIN_PAGE(page));
menu = gtk_menu_new();
menuitem = gtk_menu_item_new_with_mnemonic (_("_New"));
g_signal_connect (menuitem, "activate", G_CALLBACK(gpps_new_cb), page);
full_action_name = g_strconcat (group_name, ".SxListNewAction", NULL);
gtk_actionable_set_action_name (GTK_ACTIONABLE(menuitem), full_action_name);
g_free (full_action_name);
gtk_menu_shell_append (GTK_MENU_SHELL(menu), menuitem);
menuitem = gtk_menu_item_new_with_mnemonic (_("_Edit"));
g_signal_connect (menuitem, "activate", G_CALLBACK(gpps_edit_cb), page);
gtk_widget_set_sensitive (menuitem, count_selection > 0);
full_action_name = g_strconcat (group_name, ".SxListEditAction", NULL);
gtk_actionable_set_action_name (GTK_ACTIONABLE(menuitem), full_action_name);
g_free (full_action_name);
gtk_menu_shell_append (GTK_MENU_SHELL(menu), menuitem);
menuitem = gtk_menu_item_new_with_mnemonic (_("_Delete"));
g_signal_connect (menuitem, "activate", G_CALLBACK(gpps_delete_cb), page);
gtk_widget_set_sensitive (menuitem, count_selection > 0);
full_action_name = g_strconcat (group_name, ".SxListDeleteAction", NULL);
gtk_actionable_set_action_name (GTK_ACTIONABLE(menuitem), full_action_name);
g_free (full_action_name);
gtk_menu_shell_append (GTK_MENU_SHELL(menu), menuitem);
gtk_menu_attach_to_widget (GTK_MENU (menu), GTK_WIDGET (priv->tree_view), NULL);
@ -516,6 +511,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 ();
@ -529,15 +532,14 @@ gnc_plugin_page_sx_list_create_widget (GncPluginPage *plugin_page)
selection = gtk_tree_view_get_selection (priv->tree_view);
gtk_tree_selection_set_mode (selection, GTK_SELECTION_MULTIPLE);
gtk_tree_selection_select_path (selection, path);
gtk_tree_path_free (path);
g_signal_connect (G_OBJECT(selection), "changed", (GCallback)gppsl_selection_changed_cb, (gpointer)page);
g_signal_connect (G_OBJECT(priv->tree_view), "row-activated", (GCallback)gppsl_row_activated_cb, (gpointer)page);
g_signal_connect (G_OBJECT(gtk_tree_view_get_model (GTK_TREE_VIEW(priv->tree_view))),
"model-populated", (GCallback)gppsl_model_populated_cb, (gpointer)page);
gppsl_selection_changed_cb (selection, page);
gtk_tree_selection_select_path (selection, path);
gtk_tree_path_free (path);
}
g_signal_connect (G_OBJECT(priv->tree_view), "button-press-event",
@ -705,9 +707,12 @@ gnc_plugin_page_sx_list_recreate_page (GtkWidget *window,
static void
gnc_plugin_page_sx_list_cmd_new (GtkAction *action, GncPluginPageSxList *page)
gnc_plugin_page_sx_list_cmd_new (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
GtkWindow *window = GTK_WINDOW(gnc_plugin_page_get_window (GNC_PLUGIN_PAGE(page)));
GncPluginPageSxList *plugin_page = user_data;
GtkWindow *window = GTK_WINDOW(gnc_plugin_page_get_window (GNC_PLUGIN_PAGE(plugin_page)));
SchedXaction *new_sx;
gboolean new_sx_flag = TRUE;
@ -725,17 +730,20 @@ gnc_plugin_page_sx_list_cmd_new (GtkAction *action, GncPluginPageSxList *page)
gnc_sx_set_schedule (new_sx, schedule);
}
gnc_ui_scheduled_xaction_editor_dialog_create (window, new_sx, new_sx_flag);
gppsl_update_selected_list (page, TRUE, new_sx);
gppsl_update_selected_list (plugin_page, TRUE, new_sx);
}
static void
gnc_plugin_page_sx_list_cmd_refresh (GtkAction *action, GncPluginPageSxList *page)
gnc_plugin_page_sx_list_cmd_refresh (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
GncPluginPageSxList *plugin_page = user_data;
GncPluginPageSxListPrivate *priv;
g_return_if_fail (GNC_IS_PLUGIN_PAGE_SX_LIST(page));
g_return_if_fail (GNC_IS_PLUGIN_PAGE_SX_LIST(plugin_page));
priv = GNC_PLUGIN_PAGE_SX_LIST_GET_PRIVATE(page);
priv = GNC_PLUGIN_PAGE_SX_LIST_GET_PRIVATE(plugin_page);
gtk_widget_queue_draw (priv->widget);
}
@ -754,10 +762,13 @@ _argument_reorder_fn (GtkTreePath* list_path_data, GncTreeViewSxList* user_tree_
static void
gnc_plugin_page_sx_list_cmd_edit (GtkAction *action, GncPluginPageSxList *page)
gnc_plugin_page_sx_list_cmd_edit (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
GncPluginPageSxListPrivate *priv = GNC_PLUGIN_PAGE_SX_LIST_GET_PRIVATE(page);
GtkWindow *window = GTK_WINDOW(gnc_plugin_page_get_window (GNC_PLUGIN_PAGE(page)));
GncPluginPageSxList *plugin_page = user_data;
GncPluginPageSxListPrivate *priv = GNC_PLUGIN_PAGE_SX_LIST_GET_PRIVATE(plugin_page);
GtkWindow *window = GTK_WINDOW(gnc_plugin_page_get_window (GNC_PLUGIN_PAGE(plugin_page)));
GtkTreeSelection *selection;
GList *selected_paths, *to_edit;
GtkTreeModel *model;
@ -774,11 +785,11 @@ gnc_plugin_page_sx_list_cmd_edit (GtkAction *action, GncPluginPageSxList *page)
(GncGMapFunc)_argument_reorder_fn,
priv->tree_view);
gppsl_update_selected_list (page, TRUE, NULL);
gppsl_update_selected_list (plugin_page, TRUE, NULL);
for (GList *list = to_edit; list != NULL; list = list->next)
{
DEBUG ("to-edit [%s]\n", xaccSchedXactionGetName ((SchedXaction*)list->data));
gppsl_update_selected_list (page, FALSE, list->data);
gppsl_update_selected_list (plugin_page, FALSE, list->data);
}
g_list_foreach (to_edit, (GFunc)_edit_sx, window);
@ -787,6 +798,21 @@ gnc_plugin_page_sx_list_cmd_edit (GtkAction *action, GncPluginPageSxList *page)
g_list_free (selected_paths);
}
static void
gnc_plugin_page_sx_list_cmd_edit_tax_options (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
GncPluginPageSxList *plugin_page = user_data;
GtkWidget *window = GTK_WIDGET(gnc_plugin_page_get_window (GNC_PLUGIN_PAGE(plugin_page)));
ENTER ("(action %p, page %p)", simple, plugin_page);
gnc_tax_info_dialog (window, NULL);
LEAVE (" ");
}
static void
gppsl_row_activated_cb (GtkTreeView *tree_view,
GtkTreePath *path,
@ -819,9 +845,12 @@ _destroy_sx(gpointer data, gpointer user_data)
static void
gnc_plugin_page_sx_list_cmd_delete (GtkAction *action, GncPluginPageSxList *page)
gnc_plugin_page_sx_list_cmd_delete (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
GncPluginPageSxListPrivate *priv = GNC_PLUGIN_PAGE_SX_LIST_GET_PRIVATE(page);
GncPluginPageSxList *plugin_page = user_data;
GncPluginPageSxListPrivate *priv = GNC_PLUGIN_PAGE_SX_LIST_GET_PRIVATE(plugin_page);
GtkTreeSelection *selection;
GList *selected_paths, *to_delete = NULL;
GtkTreeModel *model;
@ -841,7 +870,7 @@ gnc_plugin_page_sx_list_cmd_delete (GtkAction *action, GncPluginPageSxList *page
(GncGMapFunc)_argument_reorder_fn,
priv->tree_view);
window = GTK_WINDOW(gnc_plugin_page_get_window (GNC_PLUGIN_PAGE(page)));
window = GTK_WINDOW(gnc_plugin_page_get_window (GNC_PLUGIN_PAGE(plugin_page)));
length = g_list_length (to_delete);
@ -852,11 +881,11 @@ gnc_plugin_page_sx_list_cmd_delete (GtkAction *action, GncPluginPageSxList *page
if (gnc_verify_dialog (window, FALSE, "%s", message))
{
gppsl_update_selected_list (page, TRUE, NULL);
gppsl_update_selected_list (plugin_page, TRUE, NULL);
for (GList *list = to_delete; list != NULL; list = list->next)
{
DEBUG("to-delete [%s]\n", xaccSchedXactionGetName ((SchedXaction*)list->data));
gppsl_update_selected_list (page, FALSE, list->data);
gppsl_update_selected_list (plugin_page, FALSE, list->data);
}
g_list_foreach (to_delete, (GFunc)_destroy_sx, NULL);
}

View File

@ -42,20 +42,24 @@ static void gnc_plugin_register_add_to_window (GncPlugin *plugin, GncMainWindow
static void gnc_plugin_register_remove_from_window (GncPlugin *plugin, GncMainWindow *window, GQuark type);
/* Command callbacks */
static void gnc_plugin_register_cmd_general_ledger (GtkAction *action, GncMainWindowActionData *data);
static void gnc_plugin_register_cmd_general_ledger (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
#define PLUGIN_ACTIONS_NAME "gnc-plugin-register-actions"
#define PLUGIN_UI_FILENAME "gnc-plugin-register-ui.xml"
#define PLUGIN_UI_FILENAME "gnc-plugin-register.ui"
static GtkActionEntry gnc_plugin_actions [] =
static GActionEntry gnc_plugin_actions [] =
{
{
"ToolsGeneralJournalAction", NULL, N_("_General Journal"), NULL,
N_("Open general journal window"),
G_CALLBACK (gnc_plugin_register_cmd_general_ledger)
},
{ "ToolsGeneralJournalAction", gnc_plugin_register_cmd_general_ledger, NULL, NULL, NULL },
};
/** The number of actions provided by this plugin. */
static guint gnc_plugin_n_actions = G_N_ELEMENTS(gnc_plugin_actions);
/** The default menu items that need to be add to the menu */
static const gchar *gnc_plugin_load_ui_items [] =
{
"ToolsPlaceholder2",
NULL,
};
static guint gnc_plugin_n_actions = G_N_ELEMENTS (gnc_plugin_actions);
typedef struct GncPluginRegisterPrivate
{
@ -133,10 +137,11 @@ gnc_plugin_register_class_init (GncPluginRegisterClass *klass)
gnc_plugin_register_remove_from_window;
/* widget addition/removal */
plugin_class->actions_name = PLUGIN_ACTIONS_NAME;
plugin_class->actions = gnc_plugin_actions;
plugin_class->n_actions = gnc_plugin_n_actions;
plugin_class->ui_filename = PLUGIN_UI_FILENAME;
plugin_class->actions_name = PLUGIN_ACTIONS_NAME;
plugin_class->actions = gnc_plugin_actions;
plugin_class->n_actions = gnc_plugin_n_actions;
plugin_class->ui_filename = PLUGIN_UI_FILENAME;
plugin_class->ui_updates = gnc_plugin_load_ui_items;
}
static void
@ -206,9 +211,11 @@ gnc_plugin_register_remove_from_window (GncPlugin *plugin,
************************************************************/
static void
gnc_plugin_register_cmd_general_ledger (GtkAction *action,
GncMainWindowActionData *data)
gnc_plugin_register_cmd_general_ledger (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
GncMainWindowActionData *data = user_data;
GncPluginPage *page;
g_return_if_fail (data != NULL);

View File

@ -43,24 +43,25 @@ static void gnc_plugin_report_system_finalize (GObject *object);
/* Command callbacks */
static void gnc_plugin_report_system_cmd_edit_style_sheet (GtkAction *action,
GncMainWindowActionData *data);
static void gnc_plugin_report_system_cmd_edit_style_sheet (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
#define PLUGIN_ACTIONS_NAME "gnc-plugin-report-system-actions"
#define PLUGIN_UI_FILENAME "gnc-plugin-report-system-ui.xml"
#define PLUGIN_UI_FILENAME "gnc-plugin-report-system.ui"
static GtkActionEntry gnc_plugin_actions [] =
static GActionEntry gnc_plugin_actions [] =
{
/* Menu Items */
{
"EditStyleSheetsAction", NULL, N_("St_yle Sheets"), NULL,
N_("Edit report style sheets"),
G_CALLBACK (gnc_plugin_report_system_cmd_edit_style_sheet)
},
{ "EditStyleSheetsAction", gnc_plugin_report_system_cmd_edit_style_sheet, NULL, NULL, NULL },
};
/** The number of actions provided by this plugin. */
static guint gnc_plugin_n_actions = G_N_ELEMENTS (gnc_plugin_actions);
/** The default menu items that need to be add to the menu */
static const gchar *gnc_plugin_load_ui_items [] =
{
"EditPlaceholder4",
NULL,
};
typedef struct GncPluginReportSystemPrivate
{
@ -92,10 +93,11 @@ gnc_plugin_report_system_class_init (GncPluginReportSystemClass *klass)
plugin_class->plugin_name = GNC_PLUGIN_REPORT_SYSTEM_NAME;
/* widget addition/removal */
plugin_class->actions_name = PLUGIN_ACTIONS_NAME;
plugin_class->actions = gnc_plugin_actions;
plugin_class->n_actions = gnc_plugin_n_actions;
plugin_class->ui_filename = PLUGIN_UI_FILENAME;
plugin_class->actions_name = PLUGIN_ACTIONS_NAME;
plugin_class->actions = gnc_plugin_actions;
plugin_class->n_actions = gnc_plugin_n_actions;
plugin_class->ui_filename = PLUGIN_UI_FILENAME;
plugin_class->ui_updates = gnc_plugin_load_ui_items;
}
static void
@ -116,10 +118,12 @@ gnc_plugin_report_system_finalize (GObject *object)
************************************************************/
static void
gnc_plugin_report_system_cmd_edit_style_sheet (GtkAction *action,
GncMainWindowActionData *data)
gnc_plugin_report_system_cmd_edit_style_sheet (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
gnc_style_sheet_dialog_open(GTK_WINDOW (data->window));
GncMainWindowActionData *data = user_data;
gnc_style_sheet_dialog_open (GTK_WINDOW(data->window));
}
/************************************************************

View File

@ -90,7 +90,7 @@
(N_ "Saved Report Configurations")
"4d3dcdc8890b11df99dd94cddfd72085"
(N_ "Manage and run saved report configurations")
(list "Reports/SavedReportConfigs")
(list "Reports/ZSavedReportConfigs") ;; Added Z so it is last in list
(lambda (window)
(gnc:debug "called into custom report dialog, window is " window)
(gnc-ui-custom-report window))))

View File

@ -49,6 +49,7 @@
#include "gnc-event.h"
#include "gnc-filepath-utils.h"
#include "gnc-gnome-utils.h"
#include "gnc-gtk-utils.h"
//#include "gnc-main-window.h"
#include "gnc-plugin-page-register.h"
#include "gnc-prefs.h"
@ -78,8 +79,9 @@ struct _RecnWindow
GtkWidget *window; /* The reconcile window */
GtkUIManager *ui_merge;
GtkActionGroup *action_group;
GtkBuilder *builder; /* The builder object */
GSimpleActionGroup *simple_action_group; /* The action group for the window */
GncPluginPage *page;
GtkWidget *starting; /* The starting balance */
@ -133,9 +135,9 @@ static void recn_destroy_cb (GtkWidget *w, gpointer data);
static void recn_cancel (RecnWindow *recnData);
static gboolean recn_delete_cb (GtkWidget *widget, GdkEvent *event, gpointer data);
static gboolean recn_key_press_cb (GtkWidget *widget, GdkEventKey *event, gpointer data);
static void recnFinishCB (GtkAction *action, RecnWindow *recnData);
static void recnPostponeCB (GtkAction *action, gpointer data);
static void recnCancelCB (GtkAction *action, gpointer data);
static void recnFinishCB (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
static void recnPostponeCB (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
static void recnCancelCB (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
void gnc_start_recn_children_changed (GtkWidget *widget, startRecnWindowData *data);
void gnc_start_recn_interest_clicked_cb (GtkButton *button, startRecnWindowData *data);
@ -145,24 +147,14 @@ static char * gnc_recn_make_window_name (Account *account);
static void gnc_recn_set_window_name (RecnWindow *recnData);
static gboolean find_by_account (gpointer find_data, gpointer user_data);
/** GLOBALS ************************************************************/
/* This static indicates the debugging module that this .o belongs to. */
G_GNUC_UNUSED static QofLogModule log_module = GNC_MOD_GUI;
static time64 gnc_reconcile_last_statement_date = 0;
/** IMPLEMENTATIONS *************************************************/
/** An array of all of the actions provided by the main window code.
* This includes some placeholder actions for the menus that are
* visible in the menu bar but have no action associated with
* them. */
static GtkActionEntry recnWindow_actions [];
/** The number of actions provided by the main window. */
static guint recnWindow_n_actions;
static gpointer
commodity_compare(Account *account, gpointer user_data) {
gboolean equal = gnc_commodity_equiv (xaccAccountGetCommodity (account),
@ -265,7 +257,7 @@ recnRecalculateBalance (RecnWindow *recnData)
gchar *datestr;
GNCPrintAmountInfo print_info;
gboolean reverse_balance, include_children;
GtkAction *action;
GAction *action;
account = recn_get_account (recnData);
if (!account)
@ -301,13 +293,13 @@ recnRecalculateBalance (RecnWindow *recnData)
gnc_add_colorized_amount (recnData->reconciled, reconciled, print_info, reverse_balance);
gnc_add_colorized_amount (recnData->difference, diff, print_info, reverse_balance);
action = gtk_action_group_get_action (recnData->action_group,
"RecnFinishAction");
gtk_action_set_sensitive(action, gnc_numeric_zero_p (diff));
action = g_action_map_lookup_action (G_ACTION_MAP(recnData->simple_action_group),
"RecnFinishAction");
g_simple_action_set_enabled (G_SIMPLE_ACTION(action), gnc_numeric_zero_p (diff));
action = gtk_action_group_get_action (recnData->action_group,
"TransBalanceAction");
gtk_action_set_sensitive(action, !gnc_numeric_zero_p (diff));
action = g_action_map_lookup_action (G_ACTION_MAP(recnData->simple_action_group),
"TransBalanceAction");
g_simple_action_set_enabled (G_SIMPLE_ACTION(action), !gnc_numeric_zero_p (diff));
return diff;
}
@ -859,7 +851,7 @@ gnc_reconcile_window_set_sensitivity(RecnWindow *recnData)
{
gboolean sensitive = FALSE;
GNCReconcileView *view;
GtkAction *action;
GAction *action;
view = GNC_RECONCILE_VIEW(recnData->debit);
if (gnc_reconcile_view_num_selected(view) == 1)
@ -869,12 +861,13 @@ gnc_reconcile_window_set_sensitivity(RecnWindow *recnData)
if (gnc_reconcile_view_num_selected(view) == 1)
sensitive = TRUE;
action = gtk_action_group_get_action (recnData->action_group,
"TransEditAction");
gtk_action_set_sensitive(action, sensitive);
action = gtk_action_group_get_action (recnData->action_group,
"TransDeleteAction");
gtk_action_set_sensitive(action, sensitive);
action = g_action_map_lookup_action (G_ACTION_MAP(recnData->simple_action_group),
"TransEditAction");
g_simple_action_set_enabled (G_SIMPLE_ACTION(action), sensitive);
action = g_action_map_lookup_action (G_ACTION_MAP(recnData->simple_action_group),
"TransDeleteAction");
g_simple_action_set_enabled (G_SIMPLE_ACTION(action), sensitive);
sensitive = FALSE;
@ -886,12 +879,13 @@ gnc_reconcile_window_set_sensitivity(RecnWindow *recnData)
if (gnc_reconcile_view_num_selected(view) > 0)
sensitive = TRUE;
action = gtk_action_group_get_action (recnData->action_group,
"TransRecAction");
gtk_action_set_sensitive(action, sensitive);
action = gtk_action_group_get_action (recnData->action_group,
"TransUnRecAction");
gtk_action_set_sensitive(action, sensitive);
action = g_action_map_lookup_action (G_ACTION_MAP(recnData->simple_action_group),
"TransRecAction");
g_simple_action_set_enabled (G_SIMPLE_ACTION(action), sensitive);
action = g_action_map_lookup_action (G_ACTION_MAP(recnData->simple_action_group),
"TransUnRecAction");
g_simple_action_set_enabled (G_SIMPLE_ACTION(action), sensitive);
}
@ -929,11 +923,14 @@ gnc_reconcile_window_row_cb(GNCReconcileView *view, gpointer item,
static void
do_popup_menu(RecnWindow *recnData, GdkEventButton *event)
{
GtkWidget *menu = gtk_ui_manager_get_widget (recnData->ui_merge, "/MainPopup");
GMenuModel *menu_model = (GMenuModel *)gtk_builder_get_object (recnData->builder,
"recwin-popup");
GtkWidget *menu = gtk_menu_new_from_model (menu_model);
if (!menu)
return;
gtk_menu_attach_to_widget (GTK_MENU(menu), GTK_WIDGET(recnData->window), NULL);
gtk_menu_popup_at_pointer (GTK_MENU(menu), (GdkEvent *) event);
}
@ -969,23 +966,25 @@ gnc_reconcile_window_button_press_cb (GtkWidget *widget,
GdkEventButton *event,
RecnWindow *recnData)
{
GNCQueryView *qview = GNC_QUERY_VIEW(widget);
GtkTreeSelection *selection;
GtkTreePath *path;
if (event->button == 3 && event->type == GDK_BUTTON_PRESS)
{
GNCQueryView *qview = GNC_QUERY_VIEW(widget);
GtkTreePath *path;
/* Get tree path for row that was clicked */
gtk_tree_view_get_path_at_pos(GTK_TREE_VIEW(qview),
(gint) event->x,
(gint) event->y,
&path, NULL, NULL, NULL);
gtk_tree_view_get_path_at_pos (GTK_TREE_VIEW(qview),
(gint) event->x,
(gint) event->y,
&path, NULL, NULL, NULL);
selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(qview));
gtk_tree_selection_select_path(selection, path);
gtk_tree_path_free(path);
do_popup_menu(recnData, event);
if (path)
{
GtkTreeSelection *selection = gtk_tree_view_get_selection (GTK_TREE_VIEW(qview));
gtk_tree_selection_select_path (selection, path);
gtk_tree_path_free (path);
}
do_popup_menu (recnData, event);
return TRUE;
}
return FALSE;
@ -1196,17 +1195,21 @@ gnc_reconcile_window_get_current_split(RecnWindow *recnData)
static void
gnc_ui_reconcile_window_help_cb(GtkWidget *widget, gpointer data)
gnc_ui_reconcile_window_help_cb (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
RecnWindow *recnData = data;
RecnWindow *recnData = user_data;
gnc_gnome_help (GTK_WINDOW(recnData->window), DF_MANUAL, DL_RECNWIN);
}
static void
gnc_ui_reconcile_window_change_cb(GtkAction *action, gpointer data)
gnc_ui_reconcile_window_change_cb (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
RecnWindow *recnData = data;
RecnWindow *recnData = user_data;
Account *account = recn_get_account (recnData);
gnc_numeric new_ending = recnData->new_ending;
time64 statement_date = recnData->statement_date;
@ -1224,9 +1227,11 @@ gnc_ui_reconcile_window_change_cb(GtkAction *action, gpointer data)
static void
gnc_ui_reconcile_window_balance_cb(GtkButton *button, gpointer data)
gnc_ui_reconcile_window_balance_cb (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
RecnWindow *recnData = data;
RecnWindow *recnData = user_data;
GNCSplitReg *gsr;
Account *account;
gnc_numeric balancing_amount;
@ -1254,9 +1259,11 @@ gnc_ui_reconcile_window_balance_cb(GtkButton *button, gpointer data)
static void
gnc_ui_reconcile_window_rec_cb(GtkButton *button, gpointer data)
gnc_ui_reconcile_window_rec_cb (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
RecnWindow *recnData = data;
RecnWindow *recnData = user_data;
GNCReconcileView *debit, *credit;
debit = GNC_RECONCILE_VIEW(recnData->debit);
@ -1268,9 +1275,11 @@ gnc_ui_reconcile_window_rec_cb(GtkButton *button, gpointer data)
static void
gnc_ui_reconcile_window_unrec_cb(GtkButton *button, gpointer data)
gnc_ui_reconcile_window_unrec_cb (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
RecnWindow *recnData = data;
RecnWindow *recnData = user_data;
GNCReconcileView *debit, *credit;
debit = GNC_RECONCILE_VIEW(recnData->debit);
@ -1363,9 +1372,11 @@ gnc_reconcile_window_delete_set_next_selection (RecnWindow *recnData, Split *spl
static void
gnc_ui_reconcile_window_delete_cb(GtkButton *button, gpointer data)
gnc_ui_reconcile_window_delete_cb (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
RecnWindow *recnData = data;
RecnWindow *recnData = user_data;
Transaction *trans;
Split *split, *next_split;
@ -1398,9 +1409,11 @@ gnc_ui_reconcile_window_delete_cb(GtkButton *button, gpointer data)
static void
gnc_ui_reconcile_window_edit_cb(GtkButton *button, gpointer data)
gnc_ui_reconcile_window_edit_cb (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
RecnWindow *recnData = data;
RecnWindow *recnData = user_data;
GNCSplitReg *gsr;
Split *split;
@ -1450,9 +1463,11 @@ gnc_recn_set_window_name(RecnWindow *recnData)
static void
gnc_recn_edit_account_cb(GtkAction *action, gpointer data)
gnc_recn_edit_account_cb (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
RecnWindow *recnData = data;
RecnWindow *recnData = user_data;
Account *account = recn_get_account (recnData);
if (account == NULL)
@ -1463,9 +1478,11 @@ gnc_recn_edit_account_cb(GtkAction *action, gpointer data)
static void
gnc_recn_xfer_cb(GtkAction *action, gpointer data)
gnc_recn_xfer_cb (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
RecnWindow *recnData = data;
RecnWindow *recnData = user_data;
Account *account = recn_get_account (recnData);
if (account == NULL)
@ -1476,9 +1493,11 @@ gnc_recn_xfer_cb(GtkAction *action, gpointer data)
static void
gnc_recn_scrub_cb(GtkAction *action, gpointer data)
gnc_recn_scrub_cb (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
RecnWindow *recnData = data;
RecnWindow *recnData = user_data;
Account *account = recn_get_account (recnData);
if (account == NULL)
@ -1498,9 +1517,11 @@ gnc_recn_scrub_cb(GtkAction *action, gpointer data)
static void
gnc_recn_open_cb(GtkAction *action, gpointer data)
gnc_recn_open_cb (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
RecnWindow *recnData = data;
RecnWindow *recnData = user_data;
gnc_reconcile_window_open_register(recnData);
}
@ -1734,21 +1755,28 @@ recnWindow (GtkWidget *parent, Account *account)
}
static void
recnWindow_add_widget (GtkUIManager *merge,
GtkWidget *widget,
GtkBox *dock)
static GActionEntry recWindow_actions_entries [] =
{
if (GTK_IS_TOOLBAR (widget))
{
gtk_toolbar_set_style (GTK_TOOLBAR(widget),
GTK_TOOLBAR_BOTH);
gtk_toolbar_set_icon_size (GTK_TOOLBAR(widget),
GTK_ICON_SIZE_SMALL_TOOLBAR);
}
gtk_box_pack_start (GTK_BOX (dock), widget, FALSE, FALSE, 0);
gtk_widget_show (widget);
}
{ "RecnChangeInfoAction", gnc_ui_reconcile_window_change_cb, NULL, NULL, NULL },
{ "RecnFinishAction", recnFinishCB, NULL, NULL, NULL },
{ "RecnPostponeAction", recnPostponeCB, NULL, NULL, NULL },
{ "RecnCancelAction", recnCancelCB, NULL, NULL, NULL },
{ "AccountOpenAccountAction", gnc_recn_open_cb, NULL, NULL, NULL },
{ "AccountEditAccountAction", gnc_recn_edit_account_cb, NULL, NULL, NULL },
{ "AccountTransferAction", gnc_recn_xfer_cb, NULL, NULL, NULL },
{ "AccountCheckRepairAction", gnc_recn_scrub_cb, NULL, NULL, NULL },
{ "TransBalanceAction", gnc_ui_reconcile_window_balance_cb, NULL, NULL, NULL },
{ "TransEditAction", gnc_ui_reconcile_window_edit_cb, NULL, NULL, NULL },
{ "TransDeleteAction", gnc_ui_reconcile_window_delete_cb, NULL, NULL, NULL },
{ "TransRecAction", gnc_ui_reconcile_window_rec_cb, NULL, NULL, NULL },
{ "TransUnRecAction", gnc_ui_reconcile_window_unrec_cb, NULL, NULL, NULL },
{ "HelpHelpAction", gnc_ui_reconcile_window_help_cb, NULL, NULL, NULL },
};
/** The number of actions provided by the reconcile window. */
static guint recnWindow_n_actions_entries = G_N_ELEMENTS(recWindow_actions_entries);
/********************************************************************\
@ -1815,48 +1843,66 @@ recnWindowWithBalance (GtkWidget *parent, Account *account, gnc_numeric new_endi
gtk_box_pack_start(GTK_BOX (vbox), dock, FALSE, TRUE, 0);
{
gchar *filename;
gint merge_id;
GtkAction *action;
GtkActionGroup *action_group;
GtkToolbar *tool_bar;
GMenuModel *menu_model;
GtkWidget *menu_bar;
GtkAccelGroup *accel_group = gtk_accel_group_new ();
const gchar *ui = "/org/gnucash/ui/gnc-reconcile-window.ui";
GError *error = NULL;
#ifdef MAC_INTEGRATION
GtkosxApplication *theApp = g_object_new (GTKOSX_TYPE_APPLICATION,
NULL);
#endif
recnData->builder = gtk_builder_new ();
recnData->ui_merge = gtk_ui_manager_new ();
g_signal_connect (recnData->ui_merge, "add_widget",
G_CALLBACK (recnWindow_add_widget), dock);
gtk_builder_add_from_resource (recnData->builder, ui, &error);
action_group = gtk_action_group_new ("ReconcileWindowActions");
recnData->action_group = action_group;
gtk_action_group_set_translation_domain(action_group, PROJECT_NAME);
gtk_action_group_add_actions (action_group, recnWindow_actions,
recnWindow_n_actions, recnData);
action =
gtk_action_group_get_action (action_group, "AccountOpenAccountAction");
g_object_set (G_OBJECT(action), "short_label", _("Open"), NULL);
gtk_builder_set_translation_domain (recnData->builder, PROJECT_NAME);
gtk_ui_manager_insert_action_group (recnData->ui_merge, action_group, 0);
filename = gnc_filepath_locate_ui_file("gnc-reconcile-window-ui.xml");
/* Can't do much without a ui. */
g_assert (filename);
merge_id = gtk_ui_manager_add_ui_from_file (recnData->ui_merge,
filename, &error);
g_assert(merge_id || error);
if (merge_id)
if (error)
{
gtk_window_add_accel_group (GTK_WINDOW (recnData->window),
gtk_ui_manager_get_accel_group(recnData->ui_merge));
gtk_ui_manager_ensure_update (recnData->ui_merge);
g_critical ("Failed to load ui resource %s, Error %s", ui, error->message);
g_error_free (error);
gnc_unregister_gui_component_by_data (WINDOW_RECONCILE_CM_CLASS, recnData);
g_free (recnData);
return NULL;
}
else
{
g_critical("Failed to load ui file.\n Filename %s\n Error %s",
filename, error->message);
g_error_free(error);
g_assert(merge_id != 0);
}
g_free(filename);
menu_model = (GMenuModel *)gtk_builder_get_object (recnData->builder, "recwin-menu");
menu_bar = gtk_menu_bar_new_from_model (menu_model);
gtk_container_add (GTK_CONTAINER(vbox), menu_bar);
#if MAC_INTEGRATION
gtk_widget_hide (menu_bar);
gtk_widget_set_no_show_all (menu_bar, TRUE);
if (GTK_IS_MENU_ITEM (menu_bar))
menu_bar = gtk_menu_item_get_submenu (GTK_MENU_ITEM (menu_bar));
gtkosx_application_set_menu_bar (theApp, GTK_MENU_SHELL (menu_bar));
g_object_unref (theApp);
theApp = NULL;
#endif
tool_bar = (GtkToolbar *)gtk_builder_get_object (recnData->builder, "recwin-toolbar");
gtk_toolbar_set_style (GTK_TOOLBAR(tool_bar), GTK_TOOLBAR_BOTH);
gtk_toolbar_set_icon_size (GTK_TOOLBAR(tool_bar),
GTK_ICON_SIZE_SMALL_TOOLBAR);
gtk_container_add (GTK_CONTAINER(vbox), GTK_WIDGET(tool_bar));
gtk_window_add_accel_group (GTK_WINDOW(recnData->window), accel_group);
// need to add the accelerator keys
gnc_add_accelerator_keys_for_menu (menu_bar, accel_group);
recnData->simple_action_group = g_simple_action_group_new ();
g_action_map_add_action_entries (G_ACTION_MAP(recnData->simple_action_group),
recWindow_actions_entries,
recnWindow_n_actions_entries,
recnData);
gtk_widget_insert_action_group (GTK_WIDGET(recnData->window), "recwin",
G_ACTION_GROUP(recnData->simple_action_group));
}
g_signal_connect(recnData->window, "popup-menu",
@ -2057,19 +2103,6 @@ use Find Transactions to find them, unreconcile, and re-reconcile."));
gnc_reconcile_window_set_titles(recnData);
#ifdef MAC_INTEGRATION
{
GtkWidget *menubar = gtk_ui_manager_get_widget (recnData->ui_merge,
"/menubar");
GtkosxApplication *theApp = g_object_new (GTKOSX_TYPE_APPLICATION,
NULL);
if (GTK_IS_MENU_ITEM (menubar))
menubar = gtk_menu_item_get_submenu (GTK_MENU_ITEM (menubar));
gtk_widget_hide (menubar);
gtkosx_application_set_menu_bar (theApp, GTK_MENU_SHELL (menubar));
g_object_unref (theApp);
}
#endif
recnRecalculateBalance(recnData);
gnc_window_adjust_for_screen(GTK_WINDOW(recnData->window));
@ -2132,6 +2165,8 @@ static void
recn_destroy_cb (GtkWidget *w, gpointer data)
{
RecnWindow *recnData = data;
gchar **actions = g_action_group_list_actions (G_ACTION_GROUP(recnData->simple_action_group));
gint num_actions = g_strv_length (actions);
gnc_unregister_gui_component_by_data (WINDOW_RECONCILE_CM_CLASS, recnData);
@ -2139,8 +2174,12 @@ recn_destroy_cb (GtkWidget *w, gpointer data)
gnc_resume_gui_refresh ();
//Disable the actions, the handlers try to access recnData
gtk_action_group_set_sensitive(recnData->action_group, FALSE);
for (gint i = 0; i < num_actions; i++)
{
GAction *action = g_simple_action_group_lookup (recnData->simple_action_group, actions[i]);
g_simple_action_set_enabled (G_SIMPLE_ACTION(action), FALSE);
}
g_strfreev (actions);
g_free (recnData);
}
@ -2280,8 +2319,11 @@ acct_traverse_descendants (Account *acct, AccountProc fn)
* Return: none *
\********************************************************************/
static void
recnFinishCB (GtkAction *action, RecnWindow *recnData)
recnFinishCB (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
RecnWindow *recnData = user_data;
gboolean auto_payment;
Account *account;
time64 date;
@ -2340,9 +2382,11 @@ recnFinishCB (GtkAction *action, RecnWindow *recnData)
* Return: none *
\********************************************************************/
static void
recnPostponeCB (GtkAction *action, gpointer data)
recnPostponeCB (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
RecnWindow *recnData = data;
RecnWindow *recnData = user_data;
Account *account;
{
@ -2370,110 +2414,10 @@ recnPostponeCB (GtkAction *action, gpointer data)
static void
recnCancelCB (GtkAction *action, gpointer data)
recnCancelCB (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
RecnWindow *recnData = data;
RecnWindow *recnData = user_data;
recn_cancel(recnData);
}
/** An array of all of the actions provided by the main window code.
* This includes some placeholder actions for the menus that are
* visible in the menu bar but have no action associated with
* them. */
static GtkActionEntry recnWindow_actions [] =
{
/* Toplevel */
{ "ReconcileMenuAction", NULL, N_("_Reconcile"), NULL, NULL, NULL, },
{ "AccountMenuAction", NULL, N_("_Account"), NULL, NULL, NULL, },
{ "TransactionMenuAction", NULL, N_("_Transaction"), NULL, NULL, NULL, },
{ "HelpMenuAction", NULL, N_("_Help"), NULL, NULL, NULL, },
/* Reconcile menu */
{
"RecnChangeInfoAction", NULL, N_("_Reconcile Information…"), NULL,
N_("Change the reconcile information "
"including statement date and ending balance."),
G_CALLBACK (gnc_ui_reconcile_window_change_cb)
},
{
"RecnFinishAction", "system-run", N_("_Finish"), "<primary>w",
N_("Finish the reconciliation of this account"),
G_CALLBACK(recnFinishCB)
},
{
"RecnPostponeAction", "go-previous", N_("_Postpone"), "<primary>p",
N_("Postpone the reconciliation of this account"),
G_CALLBACK(recnPostponeCB)
},
{
"RecnCancelAction", "process-stop", N_("_Cancel"), NULL,
N_("Cancel the reconciliation of this account"),
G_CALLBACK(recnCancelCB)
},
/* Account menu */
{
"AccountOpenAccountAction", "go-jump", N_("_Open Account"), NULL,
N_("Open the account"),
G_CALLBACK(gnc_recn_open_cb)
},
{
"AccountEditAccountAction", NULL, N_("_Edit Account"), NULL,
N_("Edit the main account for this register"),
G_CALLBACK(gnc_recn_edit_account_cb)
},
{
"AccountTransferAction", NULL, N_("_Transfer…"), NULL,
N_("Transfer funds from one account to another"),
G_CALLBACK(gnc_recn_xfer_cb)
},
{
"AccountCheckRepairAction", NULL, N_("_Check & Repair"), NULL,
N_("Check for and repair unbalanced transactions and orphan splits "
"in this account"),
G_CALLBACK(gnc_recn_scrub_cb)
},
/* Transaction menu */
{
"TransBalanceAction", "document-new", N_("_Balance"), "<primary>b",
N_("Add a new balancing entry to the account"),
G_CALLBACK(gnc_ui_reconcile_window_balance_cb)
},
{
"TransEditAction", "document-properties", N_("_Edit"), "<primary>e",
N_("Edit the current transaction"),
G_CALLBACK(gnc_ui_reconcile_window_edit_cb)
},
{
"TransDeleteAction", "edit-delete", N_("_Delete"), "<primary>d",
N_("Delete the selected transaction"),
G_CALLBACK(gnc_ui_reconcile_window_delete_cb)
},
{
"TransRecAction", "emblem-default", N_("_Reconcile Selection"), "<primary>r",
N_("Reconcile the selected transactions"),
G_CALLBACK(gnc_ui_reconcile_window_rec_cb)
},
{
"TransUnRecAction", "edit-clear", N_("_Unreconcile Selection"), "<primary>u",
N_("Unreconcile the selected transactions"),
G_CALLBACK(gnc_ui_reconcile_window_unrec_cb)
},
/* Help menu */
{
"HelpHelpAction", NULL, N_("_Help"), NULL,
N_("Open the GnuCash help window"),
G_CALLBACK(gnc_ui_reconcile_window_help_cb)
},
};
/** The number of actions provided by the main window. */
static guint recnWindow_n_actions = G_N_ELEMENTS (recnWindow_actions);

View File

@ -4,5 +4,34 @@
<gresource prefix="/org/gnucash">
<file>gnucash.css</file>
<file>gnucash-fallback.css</file>
<file>ui/gnc-embedded-register-window.ui</file>
<file>ui/gnc-main-window.ui</file>
<file>ui/gnc-plugin-account-tree.ui</file>
<file>ui/gnc-plugin-basic-commands.ui</file>
<file>ui/gnc-plugin-bi-import.ui</file>
<file>ui/gnc-plugin-budget.ui</file>
<file>ui/gnc-plugin-business.ui</file>
<file>ui/gnc-plugin-csv-export.ui</file>
<file>ui/gnc-plugin-csv-import.ui</file>
<file>ui/gnc-plugin-customer-import.ui</file>
<file>ui/gnc-plugin-file-history.ui</file>
<file>ui/gnc-plugin-log-replay.ui</file>
<file>ui/gnc-plugin-register.ui</file>
<file>ui/gnc-plugin-report-system.ui</file>
<file>ui/gnc-plugin-page-account-tree.ui</file>
<file>ui/gnc-plugin-page-budget.ui</file>
<file>ui/gnc-plugin-page-invoice.ui</file>
<file>ui/gnc-plugin-page-owner-tree.ui</file>
<file>ui/gnc-plugin-page-register.ui</file>
<file>ui/gnc-plugin-page-report.ui</file>
<file>ui/gnc-plugin-page-sx-list.ui</file>
<file>ui/gnc-plugin-ofx.ui</file>
<file>ui/gnc-plugin-aqbanking.ui</file>
<file>ui/gnc-plugin-qif-import.ui</file>
<file>ui/gnc-reconcile-window.ui</file>
</gresource>
</gresources>

View File

@ -41,8 +41,6 @@ set (aqbanking_noinst_HEADERS
set(aqbanking_GLADE assistant-ab-initial.glade dialog-ab.glade dialog-ab-pref.glade)
set(aqbanking_UI gnc-plugin-aqbanking-ui.xml)
if(WITH_AQBANKING)
add_library (gncmod-aqbanking
${aqbanking_SOURCES}
@ -84,15 +82,8 @@ endif()
# No headers to install
install(FILES ${aqbanking_GLADE} DESTINATION ${CMAKE_INSTALL_DATADIR}/gnucash/gtkbuilder)
install(FILES ${aqbanking_UI} DESTINATION ${CMAKE_INSTALL_DATADIR}/gnucash/ui)
foreach(ui_file ${aqbanking_UI})
configure_file(${ui_file} ${DATADIR_BUILD}/gnucash/ui/${ui_file} COPYONLY)
endforeach()
foreach(glade_file ${aqbanking_GLADE})
configure_file(${glade_file} ${DATADIR_BUILD}/gnucash/gtkbuilder/${glade_file} COPYONLY)
endforeach()

View File

@ -67,86 +67,53 @@ static void gnc_plugin_ab_account_selected(GncPluginPage *plugin_page, Account *
static Account *main_window_to_account(GncMainWindow *window);
/* Command callbacks */
static void gnc_plugin_ab_cmd_setup(GtkAction *action, GncMainWindowActionData *data);
static void gnc_plugin_ab_cmd_get_balance(GtkAction *action, GncMainWindowActionData *data);
static void gnc_plugin_ab_cmd_get_transactions(GtkAction *action, GncMainWindowActionData *data);
static void gnc_plugin_ab_cmd_issue_sepatransaction(GtkAction *action, GncMainWindowActionData *data);
static void gnc_plugin_ab_cmd_issue_sepainternaltransaction(GtkAction *action, GncMainWindowActionData *data);
static void gnc_plugin_ab_cmd_issue_inttransaction(GtkAction *action, GncMainWindowActionData *data);
static void gnc_plugin_ab_cmd_issue_sepa_direct_debit(GtkAction *action, GncMainWindowActionData *data);
static void gnc_plugin_ab_cmd_view_logwindow(GtkToggleAction *action, GncMainWindow *window);
static void gnc_plugin_ab_cmd_aqb_import(GtkAction *action, GncMainWindowActionData *data);
static void gnc_plugin_ab_cmd_setup (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
static void gnc_plugin_ab_cmd_get_balance (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
static void gnc_plugin_ab_cmd_get_transactions (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
static void gnc_plugin_ab_cmd_issue_sepatransaction (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
static void gnc_plugin_ab_cmd_issue_sepainternaltransaction (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
static void gnc_plugin_ab_cmd_issue_inttransaction (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
static void gnc_plugin_ab_cmd_issue_sepa_direct_debit (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
static void gnc_plugin_ab_cmd_view_logwindow (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
static void gnc_plugin_ab_cmd_aqb_import (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
#define PLUGIN_ACTIONS_NAME "gnc-plugin-aqbanking-actions"
#define PLUGIN_UI_FILENAME "gnc-plugin-aqbanking-ui.xml"
#define PLUGIN_UI_FILENAME "gnc-plugin-aqbanking.ui"
#define MENU_TOGGLE_ACTION_AB_VIEW_LOGWINDOW "ABViewLogwindowAction"
static GtkActionEntry gnc_plugin_actions [] =
static void
change_state_logwindow (GSimpleAction *simple,
GVariant *state,
gpointer user_data)
{
/* Menus */
{ "OnlineActionsAction", NULL, N_("_Online Actions"), NULL, NULL, NULL },
g_simple_action_set_state (simple, state);
}
/* Menu Items */
{
"ABSetupAction", NULL, N_("_Online Banking Setup…"), NULL,
N_("Initial setup of Online Banking access (HBCI, or OFX DirectConnect, using AqBanking)"),
G_CALLBACK(gnc_plugin_ab_cmd_setup)
},
{
"ABGetBalanceAction", NULL, N_("Get _Balance"), NULL,
N_("Get the account balance online through Online Banking"),
G_CALLBACK(gnc_plugin_ab_cmd_get_balance)
},
{
"ABGetTransAction", NULL, N_("Get _Transactions…"), NULL,
N_("Get the transactions online through Online Banking"),
G_CALLBACK(gnc_plugin_ab_cmd_get_transactions)
},
{
"ABIssueSepaTransAction", NULL,
/* Translators: https://en.wikipedia.org/wiki/Single_Euro_Payments_Area */
N_("Issue _SEPA Transaction…"), NULL,
N_("Issue a new international European (SEPA) transaction online through Online Banking"),
G_CALLBACK(gnc_plugin_ab_cmd_issue_sepatransaction)
},
{
"ABIssueSepaIntTransAction", NULL,
N_("Issue SEPA I_nternal Transaction…"), NULL,
N_("Issue a new internal European (SEPA) transaction online through Online Banking"),
G_CALLBACK(gnc_plugin_ab_cmd_issue_sepainternaltransaction)
},
{
"ABIssueIntTransAction", NULL, N_("_Internal Transaction…"), NULL,
N_("Issue a new bank-internal transaction online through Online Banking"),
G_CALLBACK(gnc_plugin_ab_cmd_issue_inttransaction)
},
{
"ABIssueSepaDirectDebitAction", NULL, N_("Issue SEPA Direct _Debit…"), NULL,
N_("Issue a new international European (SEPA) direct debit note online through Online Banking"),
G_CALLBACK(gnc_plugin_ab_cmd_issue_sepa_direct_debit)
},
/* File -> Import menu item */
{
"AQBankingImportAction", "go-previous", N_("Import using AQBanking"),
NULL, N_("Import into GnuCash any file format supported by AQBanking."),
G_CALLBACK(gnc_plugin_ab_cmd_aqb_import)
},
static GActionEntry gnc_plugin_actions [] =
{
{ "OnlineActionsAction", NULL, NULL, NULL, NULL },
{ "ABSetupAction", gnc_plugin_ab_cmd_setup, NULL, NULL, NULL },
{ "ABGetBalanceAction", gnc_plugin_ab_cmd_get_balance, NULL, NULL, NULL },
{ "ABGetTransAction", gnc_plugin_ab_cmd_get_transactions, NULL, NULL, NULL },
{ "ABIssueSepaTransAction", gnc_plugin_ab_cmd_issue_sepatransaction, NULL, NULL, NULL },
{ "ABIssueSepaIntTransAction", gnc_plugin_ab_cmd_issue_sepainternaltransaction, NULL, NULL, NULL },
{ "ABIssueIntTransAction", gnc_plugin_ab_cmd_issue_inttransaction, NULL, NULL, NULL },
{ "ABIssueSepaDirectDebitAction", gnc_plugin_ab_cmd_issue_sepa_direct_debit, NULL, NULL, NULL },
{ "AQBankingImportAction", gnc_plugin_ab_cmd_aqb_import, NULL, NULL, NULL },
{ 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);
static GtkToggleActionEntry gnc_plugin_toggle_actions [] =
/** The default menu items that need to be add to the menu */
static const gchar *gnc_plugin_load_ui_items [] =
{
{
MENU_TOGGLE_ACTION_AB_VIEW_LOGWINDOW, NULL,
N_("Show _log window"), NULL,
N_("Show the online banking log window."),
G_CALLBACK(gnc_plugin_ab_cmd_view_logwindow), TRUE
},
"FilePlaceholder1",
"ToolsPlaceholder0",
"ActionsPlaceholder1",
NULL,
};
static guint gnc_plugin_n_toggle_actions = G_N_ELEMENTS(gnc_plugin_toggle_actions);
static const gchar *need_account_actions[] =
{
@ -202,9 +169,8 @@ gnc_plugin_aqbanking_class_init(GncPluginAqBankingClass *klass)
plugin_class->actions_name = PLUGIN_ACTIONS_NAME;
plugin_class->actions = gnc_plugin_actions;
plugin_class->n_actions = gnc_plugin_n_actions;
plugin_class->toggle_actions = gnc_plugin_toggle_actions;
plugin_class->n_toggle_actions = gnc_plugin_n_toggle_actions;
plugin_class->ui_filename = PLUGIN_UI_FILENAME;
plugin_class->ui_updates = gnc_plugin_load_ui_items;
plugin_class->add_to_window = gnc_plugin_aqbanking_add_to_window;
plugin_class->remove_from_window = gnc_plugin_aqbanking_remove_from_window;
}
@ -222,20 +188,26 @@ 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_in_group (window, PLUGIN_ACTIONS_NAME,
MENU_TOGGLE_ACTION_AB_VIEW_LOGWINDOW);
gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(action), FALSE);
if (action)
{
GVariant *state = g_action_get_state (G_ACTION(action));
g_action_change_state (G_ACTION(action), g_variant_new_boolean (FALSE));
g_variant_unref (state);
}
}
static void
@ -293,7 +265,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());
@ -303,13 +275,13 @@ static void update_inactive_actions(GncPluginPage *plugin_page)
return;
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));
g_return_if_fail (GNC_IS_MAIN_WINDOW(window));
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_set_actions_enabled (G_ACTION_MAP(simple_action_group), readonly_inactive_actions,
is_readwrite);
}
@ -318,19 +290,19 @@ static void update_inactive_actions(GncPluginPage *plugin_page)
* the page that is currently selected.
*/
static void
gnc_plugin_ab_main_window_page_changed(GncMainWindow *window,
GncPluginPage *page, gpointer user_data)
gnc_plugin_ab_main_window_page_changed (GncMainWindow *window,
GncPluginPage *page, gpointer user_data)
{
Account *account = main_window_to_account(window);
Account *account = main_window_to_account (window);
/* Make sure not to call this with a NULL GncPluginPage */
if (page)
{
// Update the menu items according to the selected account
gnc_plugin_ab_account_selected(page, account, user_data);
gnc_plugin_ab_account_selected (page, account, user_data);
// Also update the action sensitivity due to read-only
update_inactive_actions(page);
update_inactive_actions (page);
}
}
@ -339,44 +311,44 @@ gnc_plugin_ab_main_window_page_changed(GncMainWindow *window,
* selecting another register page. Update the aqbanking menus appropriately.
*/
static void
gnc_plugin_ab_account_selected(GncPluginPage *plugin_page, Account *account,
gpointer user_data)
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_set_actions_enabled (G_ACTION_MAP(simple_action_group), need_account_actions,
(account && bankcode && *bankcode
&& accountid && *accountid));
gnc_main_window_set_vis_of_items_by_action (window, need_account_actions,
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_set_actions_enabled (G_ACTION_MAP(simple_action_group),
inactive_account_actions, FALSE);
gnc_main_window_set_vis_of_items_by_action (window, inactive_account_actions,
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_set_actions_enabled (G_ACTION_MAP(simple_action_group),
need_account_actions, FALSE);
gnc_main_window_set_vis_of_items_by_action (window, need_account_actions,
FALSE);
}
}
@ -446,16 +418,16 @@ main_window_to_account(GncMainWindow *window)
}
void
gnc_plugin_aqbanking_set_logwindow_visible(gboolean logwindow_visible)
gnc_plugin_aqbanking_set_logwindow_visible (gboolean logwindow_visible)
{
GtkAction *action;
GAction *action = gnc_main_window_find_action_in_group (gnc_main_window, PLUGIN_ACTIONS_NAME,
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);
GVariant *state = g_action_get_state (G_ACTION(action));
g_action_change_state (G_ACTION(action), g_variant_new_boolean (logwindow_visible));
g_variant_unref (state);
}
}
@ -464,20 +436,26 @@ gnc_plugin_aqbanking_set_logwindow_visible(gboolean logwindow_visible)
************************************************************/
static void
gnc_plugin_ab_cmd_setup(GtkAction *action, GncMainWindowActionData *data)
gnc_plugin_ab_cmd_setup (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
ENTER("action %p, main window data %p", action, data);
GncMainWindowActionData *data = user_data;
ENTER("action %p, main window data %p", simple, data);
gnc_main_window = data->window;
gnc_ab_initial_assistant();
LEAVE(" ");
}
static void
gnc_plugin_ab_cmd_get_balance(GtkAction *action, GncMainWindowActionData *data)
gnc_plugin_ab_cmd_get_balance (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
GncMainWindowActionData *data = user_data;
Account *account;
ENTER("action %p, main window data %p", action, data);
ENTER("action %p, main window data %p", simple, data);
account = main_window_to_account(data->window);
if (account == NULL)
{
@ -493,12 +471,14 @@ gnc_plugin_ab_cmd_get_balance(GtkAction *action, GncMainWindowActionData *data)
}
static void
gnc_plugin_ab_cmd_get_transactions(GtkAction *action,
GncMainWindowActionData *data)
gnc_plugin_ab_cmd_get_transactions (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
GncMainWindowActionData *data = user_data;
Account *account;
ENTER("action %p, main window data %p", action, data);
ENTER("action %p, main window data %p", simple, data);
account = main_window_to_account(data->window);
if (account == NULL)
{
@ -514,12 +494,14 @@ gnc_plugin_ab_cmd_get_transactions(GtkAction *action,
}
static void
gnc_plugin_ab_cmd_issue_sepatransaction(GtkAction *action,
GncMainWindowActionData *data)
gnc_plugin_ab_cmd_issue_sepatransaction (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
GncMainWindowActionData *data = user_data;
Account *account;
ENTER("action %p, main window data %p", action, data);
ENTER("action %p, main window data %p", simple, data);
account = main_window_to_account(data->window);
if (account == NULL)
{
@ -536,12 +518,14 @@ gnc_plugin_ab_cmd_issue_sepatransaction(GtkAction *action,
#if (AQBANKING_VERSION_INT >= 60400)
static void
gnc_plugin_ab_cmd_issue_sepainternaltransaction(GtkAction *action,
GncMainWindowActionData *data)
gnc_plugin_ab_cmd_issue_sepainternaltransaction (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
GncMainWindowActionData *data = user_data;
Account *account;
ENTER("action %p, main window data %p", action, data);
ENTER("action %p, main window data %p", simple, data);
account = main_window_to_account(data->window);
if (account == NULL)
{
@ -557,23 +541,27 @@ gnc_plugin_ab_cmd_issue_sepainternaltransaction(GtkAction *action,
}
#else
static void
gnc_plugin_ab_cmd_issue_sepainternaltransaction(GtkAction *action,
GncMainWindowActionData *data)
gnc_plugin_ab_cmd_issue_sepainternaltransaction (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
GncMainWindowActionData *data = user_data;
ENTER("action %p, main window data %p", action, data);
ENTER("action %p, main window data %p", simple, data);
PINFO("Sepa Internal Transfer not supported by your aqbanking version!");
LEAVE("Sepa Internal Transfer not supported!");
}
#endif
static void
gnc_plugin_ab_cmd_issue_inttransaction(GtkAction *action,
GncMainWindowActionData *data)
gnc_plugin_ab_cmd_issue_inttransaction (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
GncMainWindowActionData *data = user_data;
Account *account;
ENTER("action %p, main window data %p", action, data);
ENTER("action %p, main window data %p", simple, data);
account = main_window_to_account(data->window);
if (account == NULL)
{
@ -590,12 +578,14 @@ gnc_plugin_ab_cmd_issue_inttransaction(GtkAction *action,
}
static void
gnc_plugin_ab_cmd_issue_sepa_direct_debit(GtkAction *action,
GncMainWindowActionData *data)
gnc_plugin_ab_cmd_issue_sepa_direct_debit (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
GncMainWindowActionData *data = user_data;
Account *account;
ENTER("action %p, main window data %p", action, data);
ENTER("action %p, main window data %p", simple, data);
account = main_window_to_account(data->window);
if (account == NULL)
{
@ -611,29 +601,38 @@ gnc_plugin_ab_cmd_issue_sepa_direct_debit(GtkAction *action,
}
static void
gnc_plugin_ab_cmd_view_logwindow(GtkToggleAction *action, GncMainWindow *window)
gnc_plugin_ab_cmd_view_logwindow (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
if (gtk_toggle_action_get_active(GTK_TOGGLE_ACTION(action)))
GncMainWindowActionData *data = user_data;
GVariant *state;
state = g_action_get_state (G_ACTION(simple));
if (g_variant_get_boolean (state))
{
if (!gnc_GWEN_Gui_show_dialog())
{
/* Log window could not be made visible */
gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(action), FALSE);
g_action_change_state (G_ACTION(simple), g_variant_new_boolean (FALSE));
}
}
else
{
gnc_GWEN_Gui_hide_dialog();
}
g_variant_unref (state);
}
static void
gnc_plugin_ab_cmd_aqb_import(GtkAction *action,
GncMainWindowActionData *data)
gnc_plugin_ab_cmd_aqb_import (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
GncMainWindowActionData *data = user_data;
gnc_main_window = data->window;
gnc_file_aqbanking_import_dialog (GTK_WINDOW (gnc_main_window));
}
/************************************************************

View File

@ -46,19 +46,24 @@ static void gnc_plugin_bi_import_init (GncPluginbi_import *plugin)
static void gnc_plugin_bi_import_finalize (GObject *object);
/* Command callbacks */
static void gnc_plugin_bi_import_cmd_test (GtkAction *action, GncMainWindowActionData *data);
static void gnc_plugin_bi_import_cmd_test (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
#define PLUGIN_ACTIONS_NAME "gnc-plugin-bi-import-actions"
#define PLUGIN_UI_FILENAME "gnc-plugin-bi-import-ui.xml"
#define PLUGIN_UI_FILENAME "gnc-plugin-bi-import.ui"
static GtkActionEntry gnc_plugin_actions [] =
static GActionEntry gnc_plugin_actions [] =
{
/* Menu Items */
{ "ImportMenuAction", NULL, N_("_Import"), NULL, NULL, NULL },
{ "bi_importAction", "go-previous", N_("Import Bills & _Invoices…"), NULL, N_("Import bills and invoices from a CSV text file"), G_CALLBACK(gnc_plugin_bi_import_cmd_test) },
{ "bi_importAction", gnc_plugin_bi_import_cmd_test, NULL, NULL, NULL },
};
/** The number of actions provided by this plugin. */
static guint gnc_plugin_n_actions = G_N_ELEMENTS(gnc_plugin_actions);
/** The default menu items that need to be add to the menu */
static const gchar *gnc_plugin_load_ui_items [] =
{
"FilePlaceholder1",
NULL,
};
/************************************************************
* Object Implementation *
@ -84,10 +89,11 @@ gnc_plugin_bi_import_class_init (GncPluginbi_importClass *klass)
plugin_class->plugin_name = GNC_PLUGIN_BI_IMPORT_NAME;
/* widget addition/removal */
plugin_class->actions_name = PLUGIN_ACTIONS_NAME;
plugin_class->actions = gnc_plugin_actions;
plugin_class->n_actions = gnc_plugin_n_actions;
plugin_class->ui_filename = PLUGIN_UI_FILENAME;
plugin_class->actions_name = PLUGIN_ACTIONS_NAME;
plugin_class->actions = gnc_plugin_actions;
plugin_class->n_actions = gnc_plugin_n_actions;
plugin_class->ui_filename = PLUGIN_UI_FILENAME;
plugin_class->ui_updates = gnc_plugin_load_ui_items;
}
static void
@ -117,9 +123,13 @@ gnc_plugin_bi_import_create_plugin (void)
************************************************************/
static void
gnc_plugin_bi_import_cmd_test (GtkAction *action, GncMainWindowActionData *data)
gnc_plugin_bi_import_cmd_test (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
ENTER ("action %p, main window data %p", action, data);
GncMainWindowActionData *data = user_data;
ENTER ("action %p, main window data %p", simple, data);
PINFO ("bi_import");
gnc_plugin_bi_import_showGUI(GTK_WINDOW(data->window));

View File

@ -38,33 +38,28 @@ static void gnc_plugin_csv_export_init (GncPluginCsvExport *plugin);
static void gnc_plugin_csv_export_finalize (GObject *object);
/* Command callbacks */
static void gnc_plugin_csv_export_tree_cmd (GtkAction *action, GncMainWindowActionData *data);
static void gnc_plugin_csv_export_trans_cmd (GtkAction *action, GncMainWindowActionData *data);
static void gnc_plugin_csv_export_register_cmd (GtkAction *action, GncMainWindowActionData *data);
static void gnc_plugin_csv_export_tree_cmd (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
static void gnc_plugin_csv_export_trans_cmd (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
static void gnc_plugin_csv_export_register_cmd (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
#define PLUGIN_ACTIONS_NAME "gnc-plugin-csv-export-actions"
#define PLUGIN_UI_FILENAME "gnc-plugin-csv-export-ui.xml"
#define PLUGIN_UI_FILENAME "gnc-plugin-csv-export.ui"
static GtkActionEntry gnc_plugin_actions [] =
static GActionEntry gnc_plugin_actions [] =
{
{
"CsvExportTreeAction", "go-next", N_("Export Account T_ree to CSV…"), NULL,
N_("Export the Account Tree to a CSV file"),
G_CALLBACK (gnc_plugin_csv_export_tree_cmd)
},
{
"CsvExportTransAction", "go-next", N_("Export _Transactions to CSV…"), NULL,
N_("Export the Transactions to a CSV file"),
G_CALLBACK (gnc_plugin_csv_export_trans_cmd)
},
{
"CsvExportRegisterAction", "go-next", N_("Export A_ctive Register to CSV…")
/* _A is already used by Export Accounts */, NULL,
N_("Export the Active Register to a CSV file"),
G_CALLBACK (gnc_plugin_csv_export_register_cmd)
},
{ "CsvExportTreeAction", gnc_plugin_csv_export_tree_cmd, NULL, NULL, NULL },
{ "CsvExportTransAction", gnc_plugin_csv_export_trans_cmd, NULL, NULL, NULL },
{ "CsvExportRegisterAction", gnc_plugin_csv_export_register_cmd, NULL, NULL, NULL },
};
/** The number of actions provided by this plugin. */
static guint gnc_plugin_n_actions = G_N_ELEMENTS(gnc_plugin_actions);
/** The default menu items that need to be add to the menu */
static const gchar *gnc_plugin_load_ui_items [] =
{
"FilePlaceholder5",
NULL,
};
static guint gnc_plugin_n_actions = G_N_ELEMENTS (gnc_plugin_actions);
typedef struct GncPluginCsvExportPrivate
{
@ -98,10 +93,11 @@ gnc_plugin_csv_export_class_init (GncPluginCsvExportClass *klass)
plugin_class->plugin_name = GNC_PLUGIN_CSV_EXPORT_NAME;
/* widget addition/removal */
plugin_class->actions_name = PLUGIN_ACTIONS_NAME;
plugin_class->actions = gnc_plugin_actions;
plugin_class->n_actions = gnc_plugin_n_actions;
plugin_class->ui_filename = PLUGIN_UI_FILENAME;
plugin_class->actions_name = PLUGIN_ACTIONS_NAME;
plugin_class->actions = gnc_plugin_actions;
plugin_class->n_actions = gnc_plugin_n_actions;
plugin_class->ui_filename = PLUGIN_UI_FILENAME;
plugin_class->ui_updates = gnc_plugin_load_ui_items;
}
static void
@ -125,23 +121,27 @@ gnc_plugin_csv_export_finalize (GObject *object)
* Command Callbacks *
************************************************************/
static void
gnc_plugin_csv_export_tree_cmd (GtkAction *action,
GncMainWindowActionData *data)
gnc_plugin_csv_export_tree_cmd (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
gnc_file_csv_export(XML_EXPORT_TREE);
}
static void
gnc_plugin_csv_export_trans_cmd (GtkAction *action,
GncMainWindowActionData *data)
gnc_plugin_csv_export_trans_cmd (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
gnc_file_csv_export(XML_EXPORT_TRANS);
}
static void
gnc_plugin_csv_export_register_cmd (GtkAction *action,
GncMainWindowActionData *data)
gnc_plugin_csv_export_register_cmd (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
GncMainWindowActionData *data = user_data;
Query *query;
Account *acc;

View File

@ -37,32 +37,28 @@ static void gnc_plugin_csv_import_init (GncPluginCsvImport *plugin);
static void gnc_plugin_csv_import_finalize (GObject *object);
/* Command callbacks */
static void gnc_plugin_csv_import_tree_cmd (GtkAction *action, GncMainWindowActionData *data);
static void gnc_plugin_csv_import_trans_cmd (GtkAction *action, GncMainWindowActionData *data);
static void gnc_plugin_csv_import_price_cmd (GtkAction *action, GncMainWindowActionData *data);
static void gnc_plugin_csv_import_tree_cmd (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
static void gnc_plugin_csv_import_trans_cmd (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
static void gnc_plugin_csv_import_price_cmd (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
#define PLUGIN_ACTIONS_NAME "gnc-plugin-csv-import-actions"
#define PLUGIN_UI_FILENAME "gnc-plugin-csv-import-ui.xml"
#define PLUGIN_UI_FILENAME "gnc-plugin-csv-import.ui"
static GtkActionEntry gnc_plugin_actions [] =
static GActionEntry gnc_plugin_actions [] =
{
{
"CsvImportAccountAction", "go-previous", N_("Import _Accounts from CSV…"), NULL,
N_("Import Accounts from a CSV file"),
G_CALLBACK (gnc_plugin_csv_import_tree_cmd)
},
{
"CsvImportTransAction", "go-previous", N_("Import _Transactions from CSV…"), NULL,
N_("Import Transactions from a CSV file"),
G_CALLBACK (gnc_plugin_csv_import_trans_cmd)
},
{
"CsvImportPriceAction", "go-previous", N_("Import _Prices from a CSV file…"), NULL,
N_("Import Prices from a CSV file"),
G_CALLBACK (gnc_plugin_csv_import_price_cmd)
},
{ "CsvImportAccountAction", gnc_plugin_csv_import_tree_cmd, NULL, NULL, NULL },
{ "CsvImportTransAction", gnc_plugin_csv_import_trans_cmd, NULL, NULL, NULL },
{ "CsvImportPriceAction", gnc_plugin_csv_import_price_cmd, NULL, NULL, NULL },
};
/** The number of actions provided by this plugin. */
static guint gnc_plugin_n_actions = G_N_ELEMENTS(gnc_plugin_actions);
/** The default menu items that need to be add to the menu */
static const gchar *gnc_plugin_load_ui_items [] =
{
"FilePlaceholder1",
NULL,
};
static guint gnc_plugin_n_actions = G_N_ELEMENTS (gnc_plugin_actions);
typedef struct GncPluginCsvImportPrivate
{
@ -96,10 +92,11 @@ gnc_plugin_csv_import_class_init (GncPluginCsvImportClass *klass)
plugin_class->plugin_name = GNC_PLUGIN_CSV_IMPORT_NAME;
/* widget addition/removal */
plugin_class->actions_name = PLUGIN_ACTIONS_NAME;
plugin_class->actions = gnc_plugin_actions;
plugin_class->n_actions = gnc_plugin_n_actions;
plugin_class->ui_filename = PLUGIN_UI_FILENAME;
plugin_class->actions_name = PLUGIN_ACTIONS_NAME;
plugin_class->actions = gnc_plugin_actions;
plugin_class->n_actions = gnc_plugin_n_actions;
plugin_class->ui_filename = PLUGIN_UI_FILENAME;
plugin_class->ui_updates = gnc_plugin_load_ui_items;
}
static void
@ -123,22 +120,25 @@ gnc_plugin_csv_import_finalize (GObject *object)
* Command Callbacks *
************************************************************/
static void
gnc_plugin_csv_import_tree_cmd (GtkAction *action,
GncMainWindowActionData *data)
gnc_plugin_csv_import_tree_cmd (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
gnc_file_csv_account_import ();
}
static void
gnc_plugin_csv_import_trans_cmd (GtkAction *action,
GncMainWindowActionData *data)
gnc_plugin_csv_import_trans_cmd (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
gnc_file_csv_trans_import ();
}
static void
gnc_plugin_csv_import_price_cmd (GtkAction *action,
GncMainWindowActionData *data)
gnc_plugin_csv_import_price_cmd (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
gnc_file_csv_price_import ();
}

View File

@ -46,20 +46,24 @@ static void gnc_plugin_customer_import_init (GncPlugincustomer_imp
static void gnc_plugin_customer_import_finalize (GObject *object);
/* Command callbacks */
static void gnc_plugin_customer_import_cmd_test (GtkAction *action, GncMainWindowActionData *data);
static void gnc_plugin_customer_import_cmd_test (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
#define PLUGIN_ACTIONS_NAME "gnc-plugin-customer-import-actions"
#define PLUGIN_UI_FILENAME "gnc-plugin-customer-import-ui.xml"
#define PLUGIN_UI_FILENAME "gnc-plugin-customer-import.ui"
static GtkActionEntry gnc_plugin_actions [] =
static GActionEntry gnc_plugin_actions [] =
{
/* Menu Items */
{ "ImportMenuAction", NULL, N_("_Import"), NULL, NULL, NULL },
/* Menu entry with label and tooltip */
{ "customer_importAction", "go-previous", N_("Import _Customers & Vendors…"), NULL, N_("Import Customers and Vendors from a CSV text file."), G_CALLBACK(gnc_plugin_customer_import_cmd_test) },
{ "customer_importAction", gnc_plugin_customer_import_cmd_test, NULL, NULL, NULL },
};
/** The number of actions provided by this plugin. */
static guint gnc_plugin_n_actions = G_N_ELEMENTS(gnc_plugin_actions);
/** The default menu items that need to be add to the menu */
static const gchar *gnc_plugin_load_ui_items [] =
{
"FilePlaceholder1",
NULL,
};
/************************************************************
* Object Implementation *
@ -85,10 +89,11 @@ gnc_plugin_customer_import_class_init (GncPlugincustomer_importClass *klass)
plugin_class->plugin_name = GNC_PLUGIN_customer_import_NAME;
/* widget addition/removal */
plugin_class->actions_name = PLUGIN_ACTIONS_NAME;
plugin_class->actions = gnc_plugin_actions;
plugin_class->n_actions = gnc_plugin_n_actions;
plugin_class->ui_filename = PLUGIN_UI_FILENAME;
plugin_class->actions_name = PLUGIN_ACTIONS_NAME;
plugin_class->actions = gnc_plugin_actions;
plugin_class->n_actions = gnc_plugin_n_actions;
plugin_class->ui_filename = PLUGIN_UI_FILENAME;
plugin_class->ui_updates = gnc_plugin_load_ui_items;
}
static void
@ -118,9 +123,13 @@ gnc_plugin_customer_import_create_plugin (void)
************************************************************/
static void
gnc_plugin_customer_import_cmd_test (GtkAction *action, GncMainWindowActionData *data)
gnc_plugin_customer_import_cmd_test (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
ENTER ("action %p, main window data %p", action, data);
GncMainWindowActionData *data = user_data;
ENTER ("action %p, main window data %p", simple, data);
PINFO ("customer_import");
gnc_plugin_customer_import_showGUI (GTK_WINDOW(data->window));

View File

@ -36,21 +36,25 @@ static void gnc_plugin_log_replay_init (GncPluginLogreplay *plugin);
static void gnc_plugin_log_replay_finalize (GObject *object);
/* Command callbacks */
static void gnc_plugin_log_replay_cmd_new_log_replay (GtkAction *action, GncMainWindowActionData *data);
static void gnc_plugin_log_replay_cmd_new_log_replay (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
#define PLUGIN_ACTIONS_NAME "gnc-plugin-log-replay-actions"
#define PLUGIN_UI_FILENAME "gnc-plugin-log-replay-ui.xml"
#define PLUGIN_UI_FILENAME "gnc-plugin-log-replay.ui"
static GtkActionEntry gnc_plugin_actions [] =
static GActionEntry gnc_plugin_actions [] =
{
{
"LogReplayAction", "go-previous", N_("_Replay GnuCash .log file…"), NULL,
N_("Replay a GnuCash log file after a crash. This cannot be undone."),
G_CALLBACK (gnc_plugin_log_replay_cmd_new_log_replay)
},
{ "LogReplayAction", gnc_plugin_log_replay_cmd_new_log_replay, NULL, NULL, NULL },
};
/** The number of actions provided by this plugin. */
static guint gnc_plugin_n_actions = G_N_ELEMENTS(gnc_plugin_actions);
/** The default menu items that need to be add to the menu */
static const gchar *gnc_plugin_load_ui_items [] =
{
"FilePlaceholder1",
NULL,
};
static guint gnc_plugin_n_actions = G_N_ELEMENTS (gnc_plugin_actions);
typedef struct GncPluginLogreplayPrivate
{
@ -84,10 +88,11 @@ gnc_plugin_log_replay_class_init (GncPluginLogreplayClass *klass)
plugin_class->plugin_name = GNC_PLUGIN_LOG_REPLAY_NAME;
/* widget addition/removal */
plugin_class->actions_name = PLUGIN_ACTIONS_NAME;
plugin_class->actions = gnc_plugin_actions;
plugin_class->n_actions = gnc_plugin_n_actions;
plugin_class->ui_filename = PLUGIN_UI_FILENAME;
plugin_class->actions_name = PLUGIN_ACTIONS_NAME;
plugin_class->actions = gnc_plugin_actions;
plugin_class->n_actions = gnc_plugin_n_actions;
plugin_class->ui_filename = PLUGIN_UI_FILENAME;
plugin_class->ui_updates = gnc_plugin_load_ui_items;
}
static void
@ -112,9 +117,11 @@ gnc_plugin_log_replay_finalize (GObject *object)
************************************************************/
static void
gnc_plugin_log_replay_cmd_new_log_replay (GtkAction *action,
GncMainWindowActionData *data)
gnc_plugin_log_replay_cmd_new_log_replay (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
GncMainWindowActionData *data = user_data;
gnc_suspend_gui_refresh();
gnc_file_log_replay (GTK_WINDOW (data->window));
gnc_resume_gui_refresh();

View File

@ -15,8 +15,6 @@ set(ofx_noinst_HEADERS
gnc-plugin-ofx.h
)
set(ofx_UI gnc-plugin-ofx-ui.xml)
if (WITH_OFX)
add_library(gncmod-ofx ${ofx_SOURCES} ${ofx_noinst_HEADERS})
@ -36,12 +34,7 @@ endif()
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/gnucash
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
install(FILES ${ofx_UI} DESTINATION ${CMAKE_INSTALL_DATADIR}/gnucash/ui)
foreach(ui_file ${ofx_UI})
configure_file(${ui_file} ${DATADIR_BUILD}/gnucash/ui/${ui_file} COPYONLY)
endforeach()
endif()
set_local_dist(ofx_DIST_local CMakeLists.txt ${ofx_SOURCES} ${ofx_noinst_HEADERS} ${ofx_UI})
set_local_dist(ofx_DIST_local CMakeLists.txt ${ofx_SOURCES} ${ofx_noinst_HEADERS} )
set(ofx_DIST ${ofx_DIST_local} ${test_ofx_DIST} ${ofx_gschema_DIST} PARENT_SCOPE)

View File

@ -1,11 +0,0 @@
<ui>
<menubar>
<menu name="File" action="FileAction">
<menu name="FileImport" action="FileImportAction">
<placeholder name="FileImportPlaceholder">
<menuitem name="FileOfxImport" action="OfxImportAction"/>
</placeholder>
</menu>
</menu>
</menubar>
</ui>

View File

@ -34,21 +34,25 @@ static void gnc_plugin_ofx_init (GncPluginOfx *plugin);
static void gnc_plugin_ofx_finalize (GObject *object);
/* Command callbacks */
static void gnc_plugin_ofx_cmd_import (GtkAction *action, GncMainWindowActionData *data);
static void gnc_plugin_ofx_cmd_import (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
#define PLUGIN_ACTIONS_NAME "gnc-plugin-ofx-actions"
#define PLUGIN_UI_FILENAME "gnc-plugin-ofx-ui.xml"
#define PLUGIN_UI_FILENAME "gnc-plugin-ofx.ui"
static GtkActionEntry gnc_plugin_actions [] =
static GActionEntry gnc_plugin_actions [] =
{
{
"OfxImportAction", "go-previous", N_("Import _OFX/QFX…"), NULL,
N_("Process an OFX/QFX response file"),
G_CALLBACK (gnc_plugin_ofx_cmd_import)
},
{ "OfxImportAction", gnc_plugin_ofx_cmd_import, NULL, NULL, NULL },
};
/** The number of actions provided by this plugin. */
static guint gnc_plugin_n_actions = G_N_ELEMENTS(gnc_plugin_actions);
/** The default menu items that need to be add to the menu */
static const gchar *gnc_plugin_load_ui_items [] =
{
"FilePlaceholder1",
NULL,
};
static guint gnc_plugin_n_actions = G_N_ELEMENTS (gnc_plugin_actions);
typedef struct GncPluginOfxPrivate
{
@ -82,10 +86,11 @@ gnc_plugin_ofx_class_init (GncPluginOfxClass *klass)
plugin_class->plugin_name = GNC_PLUGIN_OFX_NAME;
/* widget addition/removal */
plugin_class->actions_name = PLUGIN_ACTIONS_NAME;
plugin_class->actions = gnc_plugin_actions;
plugin_class->n_actions = gnc_plugin_n_actions;
plugin_class->ui_filename = PLUGIN_UI_FILENAME;
plugin_class->actions_name = PLUGIN_ACTIONS_NAME;
plugin_class->actions = gnc_plugin_actions;
plugin_class->n_actions = gnc_plugin_n_actions;
plugin_class->ui_filename = PLUGIN_UI_FILENAME;
plugin_class->ui_updates = gnc_plugin_load_ui_items;
}
static void
@ -110,9 +115,11 @@ gnc_plugin_ofx_finalize (GObject *object)
************************************************************/
static void
gnc_plugin_ofx_cmd_import (GtkAction *action,
GncMainWindowActionData *data)
gnc_plugin_ofx_cmd_import (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
GncMainWindowActionData *data = user_data;
gnc_file_ofx_import (GTK_WINDOW (data->window));
}

View File

@ -37,20 +37,24 @@ static void gnc_plugin_qif_import_init (GncPluginQifImport *plugin);
static void gnc_plugin_qif_import_finalize (GObject *object);
/* Command callbacks */
static void gnc_plugin_qif_import_cmd_new_qif_import (GtkAction *action, GncMainWindowActionData *data);
static void gnc_plugin_qif_import_cmd_new_qif_import (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
#define PLUGIN_ACTIONS_NAME "gnc-plugin-qif-import-actions"
#define PLUGIN_UI_FILENAME "gnc-plugin-qif-import-ui.xml"
#define PLUGIN_UI_FILENAME "gnc-plugin-qif-import.ui"
static GtkActionEntry gnc_plugin_actions [] =
static GActionEntry gnc_plugin_actions [] =
{
{
"QIFImportAction", "go-previous", N_("Import _QIF…"), NULL,
N_("Import a Quicken QIF file"),
G_CALLBACK (gnc_plugin_qif_import_cmd_new_qif_import)
},
{ "QIFImportAction", gnc_plugin_qif_import_cmd_new_qif_import, NULL, NULL, NULL },
};
/** The number of actions provided by this plugin. */
static guint gnc_plugin_n_actions = G_N_ELEMENTS(gnc_plugin_actions);
/** The default menu items that need to be add to the menu */
static const gchar *gnc_plugin_load_ui_items [] =
{
"FilePlaceholder1",
NULL,
};
static guint gnc_plugin_n_actions = G_N_ELEMENTS (gnc_plugin_actions);
typedef struct GncPluginQifImportPrivate
{
@ -84,10 +88,11 @@ gnc_plugin_qif_import_class_init (GncPluginQifImportClass *klass)
plugin_class->plugin_name = GNC_PLUGIN_QIF_IMPORT_NAME;
/* widget addition/removal */
plugin_class->actions_name = PLUGIN_ACTIONS_NAME;
plugin_class->actions = gnc_plugin_actions;
plugin_class->n_actions = gnc_plugin_n_actions;
plugin_class->ui_filename = PLUGIN_UI_FILENAME;
plugin_class->actions_name = PLUGIN_ACTIONS_NAME;
plugin_class->actions = gnc_plugin_actions;
plugin_class->n_actions = gnc_plugin_n_actions;
plugin_class->ui_filename = PLUGIN_UI_FILENAME;
plugin_class->ui_updates = gnc_plugin_load_ui_items;
}
static void
@ -112,8 +117,9 @@ gnc_plugin_qif_import_finalize (GObject *object)
************************************************************/
static void
gnc_plugin_qif_import_cmd_new_qif_import (GtkAction *action,
GncMainWindowActionData *data)
gnc_plugin_qif_import_cmd_new_qif_import (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
gnc_file_qif_import();
}

View File

@ -1,33 +1,4 @@
set (ui_SOURCES
gnc-main-window-ui.xml
gnc-plugin-account-tree-ui.xml
gnc-plugin-basic-commands-ui.xml
gnc-plugin-bi-import-ui.xml
gnc-plugin-budget-ui.xml
gnc-plugin-business-ui.xml
gnc-plugin-csv-export-ui.xml
gnc-plugin-csv-import-ui.xml
gnc-plugin-customer-import-ui.xml
gnc-plugin-file-history-ui.xml
gnc-plugin-log-replay-ui.xml
gnc-plugin-page-account-tree-ui.xml
gnc-plugin-page-budget-ui.xml
gnc-plugin-page-invoice-ui.xml
gnc-plugin-page-owner-tree-ui.xml
gnc-plugin-page-register-ui.xml
gnc-plugin-page-report-ui.xml
gnc-plugin-page-sx-list2-ui.xml
gnc-plugin-page-sx-list-ui.xml
gnc-plugin-page-sxregister-ui.xml
gnc-plugin-qif-import-ui.xml
gnc-plugin-register-ui.xml
gnc-plugin-report-system-ui.xml
gnc-reconcile-window-ui.xml
gnc-sxed-to-create-window-ui.xml
gnc-sxed-window-ui-full.xml
gnc-sxed-window-ui.xml
gnc-windows-menu-ui-quartz.xml
gnc-windows-menu-ui.xml
osx_accel_map)
foreach (ui_file ${ui_SOURCES})

View File

@ -0,0 +1,239 @@
<?xml version="1.0"?>
<interface>
<menu id="embeddedwin-menu">
<submenu>
<attribute name="label" translatable="yes">_Edit</attribute>
<attribute name="action">embeddedwin.EditAction</attribute>
<section>
<item>
<attribute name="label" translatable="yes">Cu_t</attribute>
<attribute name="action">GncPluginPageRegisterActions.EditCutAction</attribute>
<attribute name="accel">&lt;Primary&gt;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">GncPluginPageRegisterActions.EditCopyAction</attribute>
<attribute name="accel">&lt;Primary&gt;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">GncPluginPageRegisterActions.EditPasteAction</attribute>
<attribute name="accel">&lt;Primary&gt;v</attribute>
<attribute name="tooltip" translatable="yes">Paste the clipboard content at the cursor position</attribute>
</item>
</section>
</submenu>
<submenu>
<attribute name="label" translatable="yes">_Transaction</attribute>
<attribute name="action">embeddedwin.TransactionAction</attribute>
<section>
<item>
<attribute name="label" translatable="no">CutTransactionAction</attribute>
<attribute name="action">GncPluginPageRegisterActions.CutTransactionAction</attribute>
<attribute name="tooltip" translatable="yes">Cut the selected transaction into clipboard</attribute>
</item>
<item>
<attribute name="label" translatable="no">CopyTransactionAction</attribute>
<attribute name="action">GncPluginPageRegisterActions.CopyTransactionAction</attribute>
<attribute name="tooltip" translatable="yes">Copy the selected transaction into clipboard</attribute>
</item>
<item>
<attribute name="label" translatable="no">PasteTransactionAction</attribute>
<attribute name="action">GncPluginPageRegisterActions.PasteTransactionAction</attribute>
<attribute name="tooltip" translatable="yes">Paste the transaction from the clipboard</attribute>
</item>
<item>
<attribute name="label" translatable="no">DuplicateTransactionAction</attribute>
<attribute name="action">GncPluginPageRegisterActions.DuplicateTransactionAction</attribute>
<attribute name="tooltip" translatable="yes">Make a copy of the current transaction</attribute>
</item>
<item>
<attribute name="label" translatable="no">DeleteTransactionAction</attribute>
<attribute name="action">GncPluginPageRegisterActions.DeleteTransactionAction</attribute>
<attribute name="tooltip" translatable="yes">Delete the current transaction</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Remo_ve Other Splits</attribute>
<attribute name="action">GncPluginPageRegisterActions.RemoveTransactionSplitsAction</attribute>
<attribute name="tooltip" translatable="yes">Remove all splits in the current transaction</attribute>
</item>
</section>
<section>
<item>
<attribute name="label" translatable="yes">_Enter Transaction</attribute>
<attribute name="action">GncPluginPageRegisterActions.RecordTransactionAction</attribute>
<attribute name="tooltip" translatable="yes">Record the current transaction</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Ca_ncel Transaction</attribute>
<attribute name="action">GncPluginPageRegisterActions.CancelTransactionAction</attribute>
<attribute name="tooltip" translatable="yes">Cancel the current transaction</attribute>
</item>
</section>
</submenu>
<submenu>
<attribute name="label" translatable="no">_View</attribute>
<attribute name="action">embeddedwin.ViewAction</attribute>
<section>
<item>
<attribute name="label" translatable="yes">_Double Line</attribute>
<attribute name="action">GncPluginPageRegisterActions.ViewStyleDoubleLineAction</attribute>
<attribute name="tooltip" translatable="yes">Show a second line with \"Action\", \"Notes\", and \"Linked Document\" for each transaction</attribute>
</item>
</section>
</submenu>
<submenu>
<attribute name="label" translatable="yes">_Action</attribute>
<attribute name="action">membeddedwin.ActionsAction</attribute>
<section>
<item>
<attribute name="label" translatable="yes">_Transfer...</attribute>
<attribute name="action">GncPluginPageRegisterActions.ActionsTransferAction</attribute>
<attribute name="accel">&lt;Primary&gt;t</attribute>
<attribute name="tooltip" translatable="yes">Transfer funds from one account to another</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Blank Transaction</attribute>
<attribute name="action">GncPluginPageRegisterActions.BlankTransactionAction</attribute>
<attribute name="accel">&lt;Primary&gt;Page_Down</attribute>
<attribute name="tooltip" translatable="yes">Move to the blank transaction at the bottom of the register</attribute>
</item>
</section>
</submenu>
</menu>
<menu id="embeddedwin-popup">
<section>
<item>
<attribute name="label" translatable="yes">Dup_licate Transaction</attribute>
<attribute name="action">GncPluginPageRegisterActions.DuplicateTransactionAction</attribute>
<attribute name="tooltip" translatable="yes">Make a copy of the current transaction</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Delete Transaction</attribute>
<attribute name="action">GncPluginPageRegisterActions.DeleteTransactionAction</attribute>
<attribute name="tooltip" translatable="yes">Delete the current transaction</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Remo_ve Other Splits</attribute>
<attribute name="action">GncPluginPageRegisterActions.RemoveTransactionSplitsAction</attribute>
<attribute name="tooltip" translatable="yes">Remove all splits in the current transaction</attribute>
</item>
</section>
<section>
<item>
<attribute name="label" translatable="yes">_Enter Transaction</attribute>
<attribute name="action">GncPluginPageRegisterActions.RecordTransactionAction</attribute>
<attribute name="tooltip" translatable="yes">Record the current transaction</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Ca_ncel Transaction</attribute>
<attribute name="action">GncPluginPageRegisterActions.CancelTransactionAction</attribute>
<attribute name="tooltip" translatable="yes">Cancel the current transaction</attribute>
</item>
</section>
<section>
<item>
<attribute name="label" translatable="yes">_Blank Transaction</attribute>
<attribute name="action">GncPluginPageRegisterActions.BlankTransactionAction</attribute>
<attribute name="tooltip" translatable="yes">Move to the blank transaction at the bottom of the register</attribute>
</item>
</section>
</menu>
<object class="GtkToolbar" id="embeddedwin-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="label" translatable="yes">Duplicate</property>
<property name="action-name">GncPluginPageRegisterActions.DuplicateTransactionAction</property>
<property name="tooltip-text" translatable="yes">Make a copy of the current transaction</property>
<property name="use-underline">True</property>
<property name="icon-name">edit-copy</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="label" translatable="yes">Delete</property>
<property name="action-name">GncPluginPageRegisterActions.DeleteTransactionAction</property>
<property name="tooltip-text" translatable="yes">Delete the current transaction</property>
<property name="use-underline">True</property>
<property name="icon-name">edit-delete</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="but3">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Enter</property>
<property name="action-name">GncPluginPageRegisterActions.RecordTransactionAction</property>
<property name="tooltip-text" translatable="yes">Record the current transaction</property>
<property name="use-underline">True</property>
<property name="icon-name">list-add</property>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
<object class="GtkToolButton" id="but4">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Cancel</property>
<property name="action-name">GncPluginPageRegisterActions.CancelTransactionAction</property>
<property name="tooltip-text" translatable="yes">Cancel the current transaction</property>
<property name="use-underline">True</property>
<property name="icon-name">process-stop</property>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
<object class="GtkToolButton" id="but5">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Blank</property>
<property name="action-name">GncPluginPageRegisterActions.BlankTransactionAction</property>
<property name="tooltip-text" translatable="yes">Move to the blank transaction at the bottom of the register</property>
<property name="use-underline">True</property>
<property name="icon-name">go-bottom</property>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
</object>
</interface>

View File

@ -1,145 +0,0 @@
<ui>
<menubar>
<menu name="File" action="FileAction">
<placeholder name="FileNewTopPlaceholder"/>
<placeholder name="FileNewMiddlePlaceholder"/>
<placeholder name="FileNewBottomPlaceholder"/>
<placeholder name="FileOpenTopPlaceholder"/>
<placeholder name="FileOpenMiddlePlaceholder"/>
<placeholder name="FileOpenBottomPlaceholder"/>
<menu name="FileImport" action="FileImportAction">
<placeholder name="FileImportPlaceholder"/>
</menu>
<separator name="FileSep1"/>
<placeholder name="FileSavePlaceholder"/>
<separator name="FileSep2"/>
<menuitem name="FilePrint" action="FilePrintAction"/>
<menuitem name="FilePageSetup" action="FilePageSetupAction"/>
<placeholder name="FilePrintPlaceholder"/>
<menu name="FileExport" action="FileExportAction">
<placeholder name="FileExportPlaceholder"/>
</menu>
<separator name="FileSep3"/>
<menuitem name="FileProperties" action="FilePropertiesAction"/>
<separator name="FileSep4"/>
<placeholder name="FileOpenRecentPlaceholder"/>
<separator name="FileSep5"/>
<menuitem name="FileClose" action="FileCloseAction"/>
<menuitem name="FileQuit" action="FileQuitAction"/>
<separator name="FileSep6"/>
</menu>
<menu name="Edit" action="EditAction">
<placeholder name="EditModificationPlaceholder"/>
<separator name="EditSep1"/>
<menuitem name="EditCut" action="EditCutAction"/>
<menuitem name="EditCopy" action="EditCopyAction"/>
<menuitem name="EditPaste" action="EditPasteAction"/>
<placeholder name="EditSelectedPlaceholder"/>
<separator name="EditSep2"/>
<placeholder name="EditAllSelectedPlaceholder"/>
<separator name="EditSep3"/>
<placeholder name="EditFindPlaceholder"/>
<separator name="EditSep4"/>
<menuitem name="EditPreferences" action="EditPreferencesAction"/>
<placeholder name="EditPreferencesPlaceholder"/>
<separator name="EditSep5"/>
<placeholder name="EditStyleSheetsPlaceholder"/>
</menu>
<menu name="View" action="ViewAction">
<menuitem name="ViewToolbar" action="ViewToolbarAction"/>
<menuitem name="ViewSummary" action="ViewSummaryAction"/>
<menuitem name="ViewStatusbar" action="ViewStatusbarAction"/>
<menu name="ViewTabPosition" action="ViewTabPositionAction">
<menuitem name="ViewTabPositionTop" action="ViewTabPositionTopAction"/>
<menuitem name="ViewTabPositionBottom" action="ViewTabPositionBottomAction"/>
<menuitem name="ViewTabPositionLeft" action="ViewTabPositionLeftAction"/>
<menuitem name="ViewTabPositionRight" action="ViewTabPositionRightAction"/>
</menu>
<separator name="ViewSep1"/>
<placeholder name="ViewContentPlaceholder"/>
<separator name="ViewSep2"/>
<menuitem name="ViewSortBy" action="ViewSortByAction"/>
<placeholder name="ViewSortPlaceholder"/>
<menuitem name="ViewFilterBy" action="ViewFilterByAction"/>
<placeholder name="ViewFilterPlaceholder"/>
<separator name="ViewSep3"/>
<placeholder name="ViewZoomPlaceholder"/>
<separator name="ViewSep4"/>
<placeholder name="ViewOtherPlaceholder"/>
<separator name="ViewSep5"/>
<menuitem name="ViewRefresh" action="ViewRefreshAction"/>
</menu>
<menu name="Transaction" action="TransactionAction">
</menu>
<menu name="Actions" action="ActionsAction">
<placeholder name="ActionsPlaceholder"/>
<separator name="ActionSepA"/>
<placeholder name="ActionsTopPlaceholder"/>
<separator name="ActionSepB"/>
<placeholder name="ActionsMiddlePlaceholder"/>
<separator name="ActionSepC"/>
<placeholder name="ActionsBottomPlaceholder"/>
<separator name="ActionSepD"/>
<menu name="ScrubMenu" action="ScrubMenuAction"/>
<separator name="ActionSepE"/>
<menuitem name="ActionsForgetWarnings" action="ActionsForgetWarningsAction"/>
<menuitem name="ActionsRenamePage" action="ActionsRenamePageAction"/>
</menu>
<placeholder name="AdditionalMenusPlaceholder"/>
<menu name="Reports" action="ReportsAction">
<placeholder name="StandardReports"/>
<separator name="ReportSep1"/>
<placeholder name="SavedReportConfigs"/>
<separator name="ReportSep2"/>
<placeholder name="AccountReports"/>
<separator name="ReportSep3"/>
<placeholder name="OtherReports"/>
<separator name="ReportSep4"/>
</menu>
<menu name="Tools" action="ToolsAction">
<placeholder name="ToolsPlaceholder"/>
</menu>
<menu name="Extensions" action="ExtensionsAction">
<placeholder name="ExtensionsPlaceholder"/>
</menu>
<menu name="Windows" action="WindowsAction">
<placeholder name= "WindowPlaceholder"/>
</menu>
<menu name="Help" action="HelpAction">
<menuitem name="HelpTutorial" action="HelpTutorialAction"/>
<placeholder name="HelpPlaceholder1"/>
<menuitem name="HelpContents" action="HelpContentsAction"/>
<menuitem name="HelpAbout" action="HelpAboutAction"/>
</menu>
</menubar>
<popup name="MainPopup" action="FakeToplevel">
<separator name="PopupSep1"/>
<placeholder name="PopupPlaceholder1"/>
<menuitem name="ActionsRenamePage" action="ActionsRenamePageAction"/>
<separator name="PopupSep2"/>
<placeholder name="PopupPlaceholder2"/>
<separator name="PopupSep3"/>
<placeholder name="PopupPlaceholder3"/>
<separator name="PopupSep4"/>
<placeholder name="PopupPlaceholder4"/>
<separator name="PopupSep5"/>
</popup>
<toolbar name="DefaultToolbar">
<placeholder name="ToolbarSavePlaceholder"/>
<toolitem name="ToolbarClose" action="FileCloseAction"/>
<separator name="ToolbarSep1"/>
<placeholder name="DefaultToolbarPlaceholder"/>
</toolbar>
</ui>

View File

@ -0,0 +1,609 @@
<?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="no">PrintPlaceholder</attribute>
<attribute name="action">mainwin.FilePlaceholder3</attribute>
<attribute name="hidden-when">action-disabled</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Pa_ge Setup...</attribute>
<attribute name="action">mainwin.FilePageSetupAction</attribute>
<attribute name="accel">&lt;Primary&gt;&lt;Shift&gt;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.FilePlaceholder4</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.FilePlaceholder5</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">&lt;Alt&gt;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.FilePlaceholder6</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">&lt;Primary&gt;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">&lt;Primary&gt;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">&lt;Primary&gt;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">&lt;Primary&gt;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">&lt;Primary&gt;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>
<item>
<attribute name="label" translatable="no">OptionsPlaceholder</attribute>
<attribute name="action">mainwin.EditPlaceholder6</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>
</section>
<section>
<item>
<attribute name="label" translatable="no">Placeholder</attribute>
<attribute name="action">mainwin.ViewPlaceholder3</attribute>
<attribute name="hidden-when">action-disabled</attribute>
</item>
</section>
<section>
<item>
<attribute name="label" translatable="no">RefreshPlaceholder</attribute>
<attribute name="action">mainwin.ViewPlaceholder4</attribute>
<attribute name="hidden-when">action-disabled</attribute>
</item>
<item>
<attribute name="label" translatable="no">AccoutTreePlaceholder</attribute>
<attribute name="action">mainwin.ViewPlaceholder5</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>
<section>
<item>
<attribute name="label" translatable="no">Placeholder</attribute>
<attribute name="action">mainwin.TransPlaceholder1</attribute>
<attribute name="hidden-when">action-disabled</attribute>
</item>
</section>
<section>
<item>
<attribute name="label" translatable="no">Placeholder</attribute>
<attribute name="action">mainwin.TransPlaceholder2</attribute>
<attribute name="hidden-when">action-disabled</attribute>
</item>
</section>
<section>
<item>
<attribute name="label" translatable="no">Placeholder</attribute>
<attribute name="action">mainwin.TransPlaceholder3</attribute>
<attribute name="hidden-when">action-disabled</attribute>
</item>
</section>
<section>
<item>
<attribute name="label" translatable="no">Placeholder</attribute>
<attribute name="action">mainwin.TransPlaceholder4</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>
<section>
<item>
<attribute name="label" translatable="no">Placeholder</attribute>
<attribute name="action">mainwin.BusinessPlaceholder0</attribute>
<attribute name="hidden-when">action-disabled</attribute>
</item>
</section>
<section>
<item>
<attribute name="label" translatable="no">Placeholder</attribute>
<attribute name="action">mainwin.BusinessPlaceholder1</attribute>
<attribute name="hidden-when">action-disabled</attribute>
</item>
</section>
<section>
<item>
<attribute name="label" translatable="no">Placeholder</attribute>
<attribute name="action">mainwin.BusinessPlaceholder2</attribute>
<attribute name="hidden-when">action-disabled</attribute>
</item>
</section>
<section>
<item>
<attribute name="label" translatable="no">Placeholder</attribute>
<attribute name="action">mainwin.BusinessPlaceholder3</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>
<item>
<attribute name="label" translatable="no">Window0Action</attribute>
<attribute name="action">mainwin.WindowAction</attribute>
<attribute name="target" type="i">0</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">&lt;Primary&gt;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>

View File

@ -1,9 +0,0 @@
<ui>
<menubar>
<menu name="View" action="ViewAction">
<placeholder name="ViewMiddlePlaceholder">
<menuitem name="ViewAccountTree" action="ViewAccountTreeAction"/>
</placeholder>
</menu>
</menubar>
</ui>

View File

@ -0,0 +1,12 @@
<?xml version="1.0"?>
<interface>
<menu id="ViewPlaceholder5">
<item>
<attribute name="label" translatable="yes">New Accounts _Page</attribute>
<attribute name="action">gnc-plugin-account-tree-actions.ViewAccountTreeAction</attribute>
<attribute name="tooltip" translatable="yes">Open a new Account Tree page</attribute>
</item>
</menu>
</interface>

View File

@ -0,0 +1,69 @@
<?xml version="1.0"?>
<interface>
<menu id="FilePlaceholder1">
<item>
<attribute name="label" translatable="yes">Import using AQBanking</attribute>
<attribute name="action">gnc-plugin-aqbanking-actions.AQBankingImportAction</attribute>
<attribute name="tooltip" translatable="yes">Import into GnuCash any file format supported by AQBanking</attribute>
</item>
</menu>
<menu id="ActionsPlaceholder1">
<submenu>
<attribute name="label" translatable="yes">_Online Actions</attribute>
<attribute name="action">gnc-plugin-aqbanking-actions.OnlineActionsAction</attribute>
<section>
<item>
<attribute name="label" translatable="yes">Get _Balance</attribute>
<attribute name="action">gnc-plugin-aqbanking-actions.ABGetBalanceAction</attribute>
<attribute name="tooltip" translatable="yes">The list of Scheduled Transactions</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Get _Transactions...</attribute>
<attribute name="action">gnc-plugin-aqbanking-actions.ABGetTransAction</attribute>
<attribute name="tooltip" translatable="yes">Get the transactions online through Online Banking</attribute>
</item>
</section>
<section>
<item>
<!-- Translators: https://en.wikipedia.org/wiki/Single_Euro_Payments_Area -->
<attribute name="label" translatable="yes">Issue _SEPA Transaction...</attribute>
<attribute name="action">gnc-plugin-aqbanking-actions.ABIssueSepaTransAction</attribute>
<attribute name="tooltip" translatable="yes">Issue a new international European (SEPA) transaction online through Online Banking</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Issue SEPA I_nternal Transaction...</attribute>
<attribute name="action">gnc-plugin-aqbanking-actions.ABIssueSepaIntTransAction</attribute>
<attribute name="tooltip" translatable="yes">Issue a new internal European (SEPA) transaction online through Online Banking</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Internal Transaction...</attribute>
<attribute name="action">gnc-plugin-aqbanking-actions.ABIssueIntTransAction</attribute>
<attribute name="tooltip" translatable="yes">Issue a new bank-internal transaction online through Online Banking</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Issue SEPA Direct _Debit...</attribute>
<attribute name="action">gnc-plugin-aqbanking-actions.ABIssueSepaDirectDebitAction</attribute>
<attribute name="tooltip" translatable="yes">Issue a new international European (SEPA) direct debit note online through Online Banking</attribute>
</item>
</section>
<section>
<item>
<attribute name="label" translatable="yes">Show _log window</attribute>
<attribute name="action">gnc-plugin-aqbanking-actions.ABViewLogwindowAction</attribute>
<attribute name="tooltip" translatable="yes">Show the online banking log window</attribute>
</item>
</section>
</submenu>
</menu>
<menu id="ToolsPlaceholder0">
<item>
<attribute name="label" translatable="yes">_Online Banking Setup...</attribute>
<attribute name="action">gnc-plugin-aqbanking-actions.ABSetupAction</attribute>
<attribute name="tt" translatable="yes">Initial setup of Online Banking access (HBCI, or OFX DirectConnect, using AqBanking)</attribute>
</item>
</menu>
</interface>

View File

@ -1,82 +0,0 @@
<ui>
<menubar>
<menu name="File" action="FileAction">
<placeholder name="FileNewTopPlaceholder">
<menuitem name="FileNew" action="FileNewAction"/>
</placeholder>
<placeholder name="FileOpenTopPlaceholder">
<menuitem name="FileOpen" action="FileOpenAction"/>
</placeholder>
<placeholder name="FileSavePlaceholder">
<menuitem name="FileSave" action="FileSaveAction"/>
<menuitem name="FileSaveAs" action="FileSaveAsAction"/>
<menuitem name="FileRevert" action="FileRevertAction"/>
</placeholder>
<menu name="FileExport" action="FileExportAction">
<menuitem name="FileExportAccounts" action="FileExportAccountsAction"/>
</menu>
</menu>
<menu name="Edit" action="EditAction">
<placeholder name="EditFindPlaceholder">
<menuitem name="EditFindTransactions" action="EditFindTransactionsAction"/>
</placeholder>
<menuitem name="EditTaxOptions" action="EditTaxOptionsAction"/>
</menu>
<menu name="View" action="ViewAction">
<menuitem name="ViewRefresh" action="ViewRefreshAction"/>
<separator name="ViewSep1"/>
<menuitem name="ViewToolbar" action="ViewToolbarAction"/>
<menuitem name="ViewSummary" action="ViewSummaryAction"/>
<menuitem name="ViewStatusbar" action="ViewStatusbarAction"/>
<separator name="ViewSep2"/>
<placeholder name="ViewPlaceholder"/>
</menu>
<menu name="Actions" action="ActionsAction">
<placeholder name="ActionsPlaceholder">
<menu name="ActionsScheduledTransactions" action="ActionsScheduledTransactionsAction">
<menuitem name="ActionsScheduledTransactionEditor" action="ActionsScheduledTransactionEditorAction"/>
<menuitem name="ActionsSinceLastRun" action="ActionsSinceLastRunAction"/>
<menuitem name="ActionsMortgageLoan" action="ActionsMortgageLoanAction"/>
</menu>
</placeholder>
</menu>
<placeholder name="AdditionalMenusPlaceholder"/>
<menu name="Reports" action="ReportsAction">
<placeholder name="ReportsPlaceholder"/>
</menu>
<menu name="Tools" action="ToolsAction">
<placeholder name="ToolsPlaceholder">
<menuitem name="ToolsPriceEditor" action="ToolsPriceEditorAction"/>
<menuitem name="ToolsCommodityEditor" action="ToolsCommodityEditorAction"/>
<menuitem name="ToolsFinancialCalculator" action="ToolsFinancialCalculatorAction"/>
<menuitem name="ToolsBookClose" action="ToolsBookCloseAction"/>
<menuitem name="ToolsImapEditor" action="ToolsImapEditorAction"/>
<menuitem name="ToolsTransLink" action="ToolsTransLinkedDocsAction"/>
</placeholder>
</menu>
<menu name="Extensions" action="ExtensionsAction">
<placeholder name="ExtensionsPlaceholder"/>
</menu>
<menu name="Help" action="HelpAction">
<placeholder name="HelpPlaceholder1">
<menuitem name="HelpTipsOfTheDay" action="HelpTipsOfTheDayAction"/>
</placeholder>
</menu>
</menubar>
<toolbar name="DefaultToolbar">
<placeholder name="ToolbarSavePlaceholder">
<toolitem name="ToolbarSave" action="FileSaveAction"/>
</placeholder>
<separator name="ToolbarSep1"/>
<placeholder name="DefaultToolbarPlaceholder"/>
</toolbar>
</ui>

View File

@ -0,0 +1,143 @@
<?xml version="1.0"?>
<interface>
<menu id="FilePlaceholder0">
<item>
<attribute name="label" translatable="yes">New _File</attribute>
<attribute name="action">gnc-plugin-basic-commands-actions.FileNewAction</attribute>
<attribute name="accel">&lt;Primary&gt;n</attribute>
<attribute name="tooltip" translatable="yes">Create a new file</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Open...</attribute>
<attribute name="action">gnc-plugin-basic-commands-actions.FileOpenAction</attribute>
<attribute name="accel">&lt;Primary&gt;o</attribute>
<attribute name="tooltip" translatable="yes">Open an existing GnuCash file</attribute>
</item>
</menu>
<menu id="FilePlaceholder2">
<item>
<attribute name="label" translatable="yes">_Save</attribute>
<attribute name="action">gnc-plugin-basic-commands-actions.FileSaveAction</attribute>
<attribute name="accel">&lt;Primary&gt;s</attribute>
<attribute name="tooltip" translatable="yes">Save the current file</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Save _As...</attribute>
<attribute name="action">gnc-plugin-basic-commands-actions.FileSaveAsAction</attribute>
<attribute name="accel">&lt;Primary&gt;&lt;Shift&gt;s</attribute>
<attribute name="tooltip" translatable="yes">Save this file with a different name</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Re_vert</attribute>
<attribute name="action">gnc-plugin-basic-commands-actions.FileRevertAction</attribute>
<attribute name="tooltip" translatable="yes">Reload the current database, reverting all unsaved changes</attribute>
</item>
</menu>
<menu id="FilePlaceholder3">
<item>
<attribute name="label" translatable="yes">_Print</attribute>
<attribute name="action">mainwin.FilePrintAction</attribute>
<attribute name="accel">&lt;Primary&gt;p</attribute>
<attribute name="tooltip" translatable="yes">Print the currently active page</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
</menu>
<menu id="FilePlaceholder5">
<item>
<attribute name="label" translatable="yes">Export _Accounts</attribute>
<attribute name="action">gnc-plugin-basic-commands-actions.FileExportAccountsAction</attribute>
<attribute name="tooltip" translatable="yes">Export the account hierarchy to a new GnuCash datafile</attribute>
</item>
</menu>
<menu id="EditPlaceholder3">
<item>
<attribute name="label" translatable="yes">_Find...</attribute>
<attribute name="action">gnc-plugin-basic-commands-actions.EditFindTransactionsAction</attribute>
<attribute name="accel">&lt;Primary&gt;f</attribute>
<attribute name="tooltip" translatable="yes">Find transactions with a search</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
</menu>
<menu id="EditPlaceholder5">
<item>
<!-- Translators: remember to reuse this translation in dialog-account.glade -->
<attribute name="label" translatable="yes">Ta_x Report Options</attribute>
<attribute name="action">gnc-plugin-basic-commands-actions.EditTaxOptionsAction</attribute>
<!-- Translators: currently implemented are, US: income tax and DE: VAT, So adjust this string -->
<attribute name="tooltip" translatable="yes">Setup relevant accounts for tax reports, e.g. US income tax</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
</menu>
<menu id="ActionsPlaceholder2">
<submenu>
<attribute name="label" translatable="yes">_Scheduled Transactions</attribute>
<attribute name="action">gnc-plugin-basic-commands-actions.ActionsScheduledTransactionsAction</attribute>
<section>
<item>
<attribute name="label" translatable="yes">_Scheduled Transaction Editor</attribute>
<attribute name="action">gnc-plugin-basic-commands-actions.ActionsScheduledTransactionEditorAction</attribute>
<attribute name="tooltip" translatable="yes">The list of Scheduled Transactions</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Since _Last Run...</attribute>
<attribute name="action">gnc-plugin-basic-commands-actions.ActionsSinceLastRunAction</attribute>
<attribute name="tooltip" translatable="yes">Create Scheduled Transactions since the last time run</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Mortgage &amp; Loan Repayment...</attribute>
<attribute name="action">gnc-plugin-basic-commands-actions.ActionsMortgageLoanAction</attribute>
<attribute name="tooltip" translatable="yes">Setup scheduled transactions for repayment of a loan</attribute>
</item>
</section>
</submenu>
</menu>
<menu id="ToolsPlaceholder1">
<item>
<attribute name="label" translatable="yes">_Price Database</attribute>
<attribute name="action">gnc-plugin-basic-commands-actions.ToolsPriceEditorAction</attribute>
<attribute name="tooltip" translatable="yes">View and edit the prices for stocks and mutual funds</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Security Editor</attribute>
<attribute name="action">gnc-plugin-basic-commands-actions.ToolsCommodityEditorAction</attribute>
<attribute name="tooltip" translatable="yes">View and edit the commodities for stocks and mutual funds</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Loan Repayment Calculator</attribute>
<attribute name="action">gnc-plugin-basic-commands-actions.ToolsFinancialCalculatorAction</attribute>
<attribute name="tooltip" translatable="yes">Use the loan/mortgage repayment calculator</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Close Book</attribute>
<attribute name="action">gnc-plugin-basic-commands-actions.ToolsBookCloseAction</attribute>
<attribute name="tooltip" translatable="yes">Close the Book at the end of the Period</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Import Map Editor</attribute>
<attribute name="action">gnc-plugin-basic-commands-actions.ToolsImapEditorAction</attribute>
<attribute name="tooltip" translatable="yes">View and Delete Bayesian and non-Bayesian information</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Transaction Linked Documents</attribute>
<attribute name="action">gnc-plugin-basic-commands-actions.ToolsTransLinkedDocsAction</attribute>
<attribute name="tooltip" translatable="yes">View all Transaction Linked Documents</attribute>
</item>
</menu>
<menu id="HelpPlaceholder1">
<item>
<attribute name="label" translatable="yes">_Tips Of The Day</attribute>
<attribute name="action">gnc-plugin-basic-commands-actions.HelpTipsOfTheDayAction</attribute>
<attribute name="tooltip" translatable="yes">View the Tips of the Day</attribute>
</item>
</menu>
</interface>

View File

@ -1,11 +0,0 @@
<ui>
<menubar>
<menu name="File" action="FileAction">
<menu name="FileImport" action="FileImportAction">
<placeholder name="FileImportPlaceholder">
<menuitem name="bi_import" action="bi_importAction"/>
</placeholder>
</menu>
</menu>
</menubar>
</ui>

View File

@ -0,0 +1,12 @@
<?xml version="1.0"?>
<interface>
<menu id="FilePlaceholder1">
<item>
<attribute name="label" translatable="yes">Import Bills &amp; _Invoices...</attribute>
<attribute name="action">gnc-plugin-bi-import-actions.bi_importAction</attribute>
<attribute name="tooltip" translatable="yes">Import bills and invoices from a CSV text file</attribute>
</item>
</menu>
</interface>

View File

@ -1,15 +0,0 @@
<ui>
<menubar>
<menu name="Actions" action="ActionsAction">
<placeholder name="ActionsPlaceholder">
<menu name="ActionsBudget" action="ActionsBudgetAction">
<menuitem name="BudgetNewBudget" action="NewBudgetAction"/>
<menuitem name="BudgetOpenBudget" action="OpenBudgetAction"/>
<menuitem name="BudgetCopyBudget" action="CopyBudgetAction"/>
<menuitem name="BudgetDeleteBudget" action="DeleteBudgetAction"/>
</menu>
</placeholder>
</menu>
</menubar>
</ui>

View File

@ -0,0 +1,33 @@
<?xml version="1.0"?>
<interface>
<menu id="ActionsPlaceholder3">
<submenu>
<attribute name="label" translatable="yes">B_udget</attribute>
<attribute name="action">gnc-plugin-budget-actions.ActionsBudgetAction</attribute>
<section>
<item>
<attribute name="label" translatable="yes">_New Budget</attribute>
<attribute name="action">gnc-plugin-budget-actions.NewBudgetAction</attribute>
<attribute name="tooltip" translatable="yes">Create a new Budget</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Open Budget</attribute>
<attribute name="action">gnc-plugin-budget-actions.OpenBudgetAction</attribute>
<attribute name="tooltip" translatable="yes">Open an existing Budget in a new tab. If none exists a new budget will be created</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Copy Budget</attribute>
<attribute name="action">gnc-plugin-budget-actions.CopyBudgetAction</attribute>
<attribute name="tooltip" translatable="yes">Copy an existing Budget</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Delete Budget</attribute>
<attribute name="action">gnc-plugin-budget-actions.DeleteBudgetAction</attribute>
<attribute name="tooltip" translatable="yes">Delete an existing Budget</attribute>
</item>
</section>
</submenu>
</menu>
</interface>

View File

@ -1,81 +0,0 @@
<ui>
<menubar>
<menu name="Edit" action="EditAction">
<placeholder name="EditSelectedPlaceholder">
<menuitem name="RegisterAssignPayment" action="RegisterAssignPayment"/>
<menuitem name="RegisterEditPayment" action="RegisterEditPayment"/>
</placeholder>
</menu>
<placeholder name="AdditionalMenusPlaceholder">
<menu name="Business" action="BusinessAction">
<menu name="CustomerMenu" action="CustomerMenuAction">
<menuitem name="CustomerOverviewPage" action="CustomerOverviewPageAction"/>
<menuitem name="CustomerNewCustomerOpen" action="CustomerNewCustomerOpenAction"/>
<menuitem name="CustomerFindCustomerOpen" action="CustomerFindCustomerOpenAction"/>
<menuitem name="CustomerNewInvoiceOpen" action="CustomerNewInvoiceOpenAction"/>
<menuitem name="CustomerFindInvoiceOpen" action="CustomerFindInvoiceOpenAction"/>
<menuitem name="CustomerNewJobOpen" action="CustomerNewJobOpenAction"/>
<menuitem name="CustomerFindJobOpen" action="CustomerFindJobOpenAction"/>
<menuitem name="CustomerProcessPayment" action="CustomerProcessPaymentAction"/>
<menuitem name="InvoicesDueReminderOpen" action="InvoicesDueReminderOpenAction"/>
</menu>
<menu name="VendorMenu" action="VendorMenuAction">
<menuitem name="VendorOverviewPage" action="VendorOverviewPageAction"/>
<menuitem name="VendorNewVendorOpen" action="VendorNewVendorOpenAction"/>
<menuitem name="VendorFindVendorOpen" action="VendorFindVendorOpenAction"/>
<menuitem name="VendorNewBillOpen" action="VendorNewBillOpenAction"/>
<menuitem name="VendorFindBillOpen" action="VendorFindBillOpenAction"/>
<menuitem name="VendorNewJobOpen" action="VendorNewJobOpenAction"/>
<menuitem name="VendorFindJobOpen" action="VendorFindJobOpenAction"/>
<menuitem name="VendorProcessPayment" action="VendorProcessPaymentAction"/>
<menuitem name="BillsDueReminderOpen" action="BillsDueReminderOpenAction"/>
</menu>
<menu name="EmployeeMenu" action="EmployeeMenuAction">
<menuitem name="EmployeeOverviewPage" action="EmployeeOverviewPageAction"/>
<menuitem name="EmployeeNewEmployeeOpen" action="EmployeeNewEmployeeOpenAction"/>
<menuitem name="EmployeeFindEmployeeOpen" action="EmployeeFindEmployeeOpenAction"/>
<menuitem name="EmployeeNewExpenseOpen" action="EmployeeNewExpenseVoucherOpenAction"/>
<menuitem name="EmployeeFindExpenseOpen" action="EmployeeFindExpenseVoucherOpenAction"/>
<menuitem name="EmployeeProcessPayment" action="EmployeeProcessPaymentAction"/>
</menu>
<menuitem name="BusinessLinkOpen" action="BusinessLinkedDocsAction"/>
<placeholder name="BusinessPlaceholderTop"/>
<separator name="Sep1"/>
<menuitem name="TaxTablesOpen" action="TaxTablesOpenAction"/>
<menuitem name="BillingTermsOpen" action="BillingTermsOpenAction"/>
<placeholder name="BusinessPlaceholderMiddle"/>
<placeholder name="BusinessPlaceholderBottom"/>
</menu>
</placeholder>
<menu name="Extensions" action="ExtensionsAction">
<placeholder name="ExtensionsPlaceholder">
<menu name="BusinessTest" action="BusinessTestAction">
<menuitem name="BusinessTestSearch" action="BusinessTestSearchAction"/>
<menuitem name="BusinessTestInitData" action="BusinessTestInitDataAction"/>
</menu>
</placeholder>
</menu>
</menubar>
<toolbar name="DefaultToolbar">
<placeholder name="DefaultToolbarPlaceholder">
<toolitem name="ToolbarInvoiceNew" action="ToolbarNewInvoiceAction"/>
</placeholder>
</toolbar>
<popup name="MainPopup" action="FakeToplevel">
<!--separator name="PopupSep3"/-->
<placeholder name="PopupPlaceholder3">
<menuitem name="RegisterAssignPayment" action="RegisterAssignPayment"/>
<menuitem name="RegisterEditPayment" action="RegisterEditPayment"/>
</placeholder>
</popup>
</ui>

View File

@ -0,0 +1,176 @@
<?xml version="1.0"?>
<interface>
<menu id="BusinessPlaceholder0">
<submenu>
<attribute name="label" translatable="yes">_Customer</attribute>
<attribute name="action">gnc-plugin-business-actions.CustomerMenuAction</attribute>
<item>
<attribute name="label" translatable="yes">Customers Overview</attribute>
<attribute name="action">gnc-plugin-business-actions.CustomerOverviewPageAction</attribute>
<attribute name="tooltip" translatable="yes">Open a Customer overview page</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_New Customer...</attribute>
<attribute name="action">gnc-plugin-business-actions.CustomerNewCustomerOpenAction</attribute>
<attribute name="tooltip" translatable="yes">Open the New Customer dialog</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Find Customer...</attribute>
<attribute name="action">gnc-plugin-business-actions.CustomerFindCustomerOpenAction</attribute>
<attribute name="tooltip" translatable="yes">Open the Find Customer dialog</attribute>
</item>
<item>
<attribute name="label" translatable="yes">New _Invoice...</attribute>
<attribute name="action">gnc-plugin-business-actions.CustomerNewInvoiceOpenAction</attribute>
<attribute name="tooltip" translatable="yes">Open the New Invoice dialog</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Find In_voice...</attribute>
<attribute name="action">gnc-plugin-business-actions.CustomerFindInvoiceOpenAction</attribute>
<attribute name="tooltip" translatable="yes">Open the Find Invoice dialog</attribute>
</item>
<item>
<attribute name="label" translatable="yes">New _Job...</attribute>
<attribute name="action">gnc-plugin-business-actions.CustomerNewJobOpenAction</attribute>
<attribute name="tooltip" translatable="yes">Open the New Job dialog</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Find Jo_b...</attribute>
<attribute name="action">gnc-plugin-business-actions.CustomerFindJobOpenAction</attribute>
<attribute name="tooltip" translatable="yes">Open the Find Job dialog</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Process Payment...</attribute>
<attribute name="action">gnc-plugin-business-actions.CustomerProcessPaymentAction</attribute>
<attribute name="tooltip" translatable="yes">Open the Process Payment dialog</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Invoices _Due Reminder</attribute>
<attribute name="action">gnc-plugin-business-actions.InvoicesDueReminderOpenAction</attribute>
<attribute name="tooltip" translatable="yes">Open the Invoices Due Reminder dialog</attribute>
</item>
</submenu>
<submenu>
<attribute name="label" translatable="yes">_Vendor</attribute>
<attribute name="action">gnc-plugin-business-actions.VendorMenuAction</attribute>
<item>
<attribute name="label" translatable="yes">Vendors Overview</attribute>
<attribute name="action">gnc-plugin-business-actions.VendorOverviewPageAction</attribute>
<attribute name="tooltip" translatable="yes">Open a Vendor overview page</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_New Vendor...</attribute>
<attribute name="action">gnc-plugin-business-actions.VendorNewVendorOpenAction</attribute>
<attribute name="tooltip" translatable="yes">Open the New Vendor dialog</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Find Vendor...</attribute>
<attribute name="action">gnc-plugin-business-actions.VendorFindVendorOpenAction</attribute>
<attribute name="tooltip" translatable="yes">Open the Find Vendor dialog</attribute>
</item>
<item>
<attribute name="label" translatable="yes">New _Bill...</attribute>
<attribute name="action">gnc-plugin-business-actions.VendorNewBillOpenAction</attribute>
<attribute name="tooltip" translatable="yes">Open the New Bill dialog</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Find Bi_ll...</attribute>
<attribute name="action">gnc-plugin-business-actions.VendorFindBillOpenAction</attribute>
<attribute name="tooltip" translatable="yes">Open the Find Bill dialog</attribute>
</item>
<item>
<attribute name="label" translatable="yes">New _Job...</attribute>
<attribute name="action">gnc-plugin-business-actions.VendorNewJobOpenAction</attribute>
<attribute name="tooltip" translatable="yes">Open the New Job dialog</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Find Jo_b...</attribute>
<attribute name="action">gnc-plugin-business-actions.VendorFindJobOpenAction</attribute>
<attribute name="tooltip" translatable="yes">Open the Find Job dialog</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Process Payment...</attribute>
<attribute name="action">gnc-plugin-business-actions.VendorProcessPaymentAction</attribute>
<attribute name="tooltip" translatable="yes">Open the Process Payment dialog</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Bills _Due Reminder</attribute>
<attribute name="action">gnc-plugin-business-actions.BillsDueReminderOpenAction</attribute>
<attribute name="tooltip" translatable="yes">Open the Bills Due Reminder dialog</attribute>
</item>
</submenu>
<submenu>
<attribute name="label" translatable="yes">_Employee</attribute>
<attribute name="action">gnc-plugin-business-actions.EmployeeMenuAction</attribute>
<item>
<attribute name="label" translatable="yes">Employees Overview</attribute>
<attribute name="action">gnc-plugin-business-actions.EmployeeOverviewPageAction</attribute>
<attribute name="tooltip" translatable="yes">Open a Employee overview page</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_New Employee...</attribute>
<attribute name="action">gnc-plugin-business-actions.EmployeeNewEmployeeOpenAction</attribute>
<attribute name="tooltip" translatable="yes">Open the New Employee dialog</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Find Employee...</attribute>
<attribute name="action">gnc-plugin-business-actions.EmployeeFindEmployeeOpenAction</attribute>
<attribute name="tooltip" translatable="yes">Open the Find Employee dialog</attribute>
</item>
<item>
<attribute name="label" translatable="yes">New _Expense Voucher...</attribute>
<attribute name="action">gnc-plugin-business-actions.EmployeeNewExpenseVoucherOpenAction</attribute>
<attribute name="tooltip" translatable="yes">Open the New Voucher dialog</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Find Expense _Voucher...</attribute>
<attribute name="action">gnc-plugin-business-actions.EmployeeFindExpenseVoucherOpenAction</attribute>
<attribute name="tooltip" translatable="yes">Open the Find Expense Voucher dialog</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Process Payment...</attribute>
<attribute name="action">gnc-plugin-business-actions.EmployeeProcessPaymentAction</attribute>
<attribute name="tooltip" translatable="yes">Open the Process Payment dialog</attribute>
</item>
</submenu>
<item>
<attribute name="label" translatable="yes">Business Linked Documents</attribute>
<attribute name="action">gnc-plugin-business-actions.BusinessLinkedDocsAction</attribute>
<attribute name="tooltip" translatable="yes">View all Linked Business Documents</attribute>
</item>
</menu>
<menu id="BusinessPlaceholder1">
<item>
<attribute name="label" translatable="yes">Sales _Tax Table</attribute>
<attribute name="action">gnc-plugin-business-actions.TaxTablesOpenAction</attribute>
<attribute name="tooltip" translatable="yes">View and edit the list of Sales Tax Tables (GST/VAT)</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Billing Terms Editor</attribute>
<attribute name="action">gnc-plugin-business-actions.BillingTermsOpenAction</attribute>
<attribute name="tooltip" translatable="yes">View and edit the list of Billing Terms</attribute>
</item>
</menu>
<menu id="ExtensionsPlaceholder0">
<submenu>
<attribute name="label" translatable="yes">_Business</attribute>
<attribute name="action">gnc-plugin-business-actions.BusinessTestAction</attribute>
<section>
<item>
<attribute name="label" translatable="yes">Test Search Dialog</attribute>
<attribute name="action">gnc-plugin-business-actions.BusinessTestSearchAction</attribute>
<attribute name="tooltip" translatable="yes">Test Search Dialog</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Initialize Test Data</attribute>
<attribute name="action">gnc-plugin-business-actions.BusinessTestInitDataAction</attribute>
<attribute name="tooltip" translatable="yes">Initialize Test Data</attribute>
</item>
</section>
</submenu>
</menu>
</interface>

View File

@ -1,13 +0,0 @@
<ui>
<menubar>
<menu name="File" action="FileAction">
<menu name="FileExport" action="FileExportAction">
<placeholder name="FileExportPlaceholder">
<menuitem name="FileCsvExportTree" action="CsvExportTreeAction"/>
<menuitem name="FileCsvExportTrans" action="CsvExportTransAction"/>
<menuitem name="FileCsvExportRegister" action="CsvExportRegisterAction"/>
</placeholder>
</menu>
</menu>
</menubar>
</ui>

View File

@ -0,0 +1,22 @@
<?xml version="1.0"?>
<interface>
<menu id="FilePlaceholder5">
<item>
<attribute name="label" translatable="yes">Export Account T_ree to CSV...</attribute>
<attribute name="action">gnc-plugin-csv-export-actions.CsvExportTreeAction</attribute>
<attribute name="tooltip" translatable="yes">Export the Account Tree to a CSV file</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Export _Transactions to CSV...</attribute>
<attribute name="action">gnc-plugin-csv-export-actions.CsvExportTransAction</attribute>
<attribute name="tooltip" translatable="yes">Export the Transactions to a CSV file</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Export A_ctive Register to CSV...</attribute>
<attribute name="action">gnc-plugin-csv-export-actions.CsvExportRegisterAction</attribute>
<attribute name="tooltip" translatable="yes">Export the Active Register to a CSV file</attribute>
</item>
</menu>
</interface>

View File

@ -1,13 +0,0 @@
<ui>
<menubar>
<menu name="File" action="FileAction">
<menu name="FileImport" action="FileImportAction">
<placeholder name="FileImportPlaceholder">
<menuitem name="FileCsvImportAccounts" action="CsvImportAccountAction"/>
<menuitem name="FileCsvImportTrans" action="CsvImportTransAction"/>
<menuitem name="FileCsvImportPrice" action="CsvImportPriceAction"/>
</placeholder>
</menu>
</menu>
</menubar>
</ui>

View File

@ -0,0 +1,22 @@
<?xml version="1.0"?>
<interface>
<menu id="FilePlaceholder1">
<item>
<attribute name="label" translatable="yes">Import _Accounts from CSV...</attribute>
<attribute name="action">gnc-plugin-csv-import-actions.CsvImportAccountAction</attribute>
<attribute name="tooltip" translatable="yes">Import Accounts from a CSV file</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Import _Transactions from CSV...</attribute>
<attribute name="action">gnc-plugin-csv-import-actions.CsvImportTransAction</attribute>
<attribute name="tooltip" translatable="yes">Import Transactions from a CSV file</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Import _Prices from a CSV file...</attribute>
<attribute name="action">gnc-plugin-csv-import-actions.CsvImportPriceAction</attribute>
<attribute name="tooltip" translatable="yes">Import Prices from a CSV file</attribute>
</item>
</menu>
</interface>

View File

@ -1,11 +0,0 @@
<ui>
<menubar>
<menu name="File" action="FileAction">
<menu name="FileImport" action="FileImportAction">
<placeholder name="FileImportPlaceholder">
<menuitem name="customer_import" action="customer_importAction"/>
</placeholder>
</menu>
</menu>
</menubar>
</ui>

View File

@ -0,0 +1,12 @@
<?xml version="1.0"?>
<interface>
<menu id="FilePlaceholder1">
<item>
<attribute name="label" translatable="yes">Import _Customers &amp; Vendors...</attribute>
<attribute name="action">gnc-plugin-customer-import-actions.customer_importAction</attribute>
<attribute name="tooltip" translatable="yes">Import Customers and Vendors from a CSV text file</attribute>
</item>
</menu>
</interface>

View File

@ -1,19 +0,0 @@
<ui>
<menubar>
<menu name="File" action="FileAction">
<placeholder name="FileOpenRecentPlaceholder">
<menuitem name="RecentFile0" action="RecentFile0Action"/>
<menuitem name="RecentFile1" action="RecentFile1Action"/>
<menuitem name="RecentFile2" action="RecentFile2Action"/>
<menuitem name="RecentFile3" action="RecentFile3Action"/>
<menuitem name="RecentFile4" action="RecentFile4Action"/>
<menuitem name="RecentFile5" action="RecentFile5Action"/>
<menuitem name="RecentFile6" action="RecentFile6Action"/>
<menuitem name="RecentFile7" action="RecentFile7Action"/>
<menuitem name="RecentFile8" action="RecentFile8Action"/>
<menuitem name="RecentFile9" action="RecentFile9Action"/>
</placeholder>
</menu>
</menubar>
</ui>

View File

@ -0,0 +1,12 @@
<?xml version="1.0"?>
<interface>
<menu id="FilePlaceholder6">
<item>
<attribute name="label" translatable="no">RecentFile0Action</attribute>
<attribute name="action">gnc-plugin-file-history-actions.RecentFile0Action</attribute>
<attribute name="tooltip" translatable="yes">Edit the properties of the current file</attribute>
</item>
</menu>
</interface>

View File

@ -1,11 +0,0 @@
<ui>
<menubar>
<menu name="File" action="FileAction">
<menu name="FileImport" action="FileImportAction">
<placeholder name="FileImportPlaceholder">
<menuitem name="LogReplay" action="LogReplayAction"/>
</placeholder>
</menu>
</menu>
</menubar>
</ui>

View File

@ -0,0 +1,12 @@
<?xml version="1.0"?>
<interface>
<menu id="FilePlaceholder1">
<item>
<attribute name="label" translatable="yes">_Replay GnuCash .log file...</attribute>
<attribute name="action">gnc-plugin-log-replay-actions.LogReplayAction</attribute>
<attribute name="tooltip" translatable="yes">Replay a GnuCash log file after a crash. This cannot be undone</attribute>
</item>
</menu>
</interface>

View File

@ -0,0 +1,12 @@
<?xml version="1.0"?>
<interface>
<menu id="FilePlaceholder1">
<item>
<attribute name="label" translatable="yes">Import _OFX/QFX...</attribute>
<attribute name="action">gnc-plugin-ofx-actions.OfxImportAction</attribute>
<attribute name="tooltip" translatable="yes">Process an OFX/QFX response file</attribute>
</item>
</menu>
</interface>

View File

@ -1,79 +0,0 @@
<ui>
<menubar>
<menu name="Edit" action="EditAction">
<placeholder name="EditSelectedPlaceholder">
<menuitem name="EditEditAccount" action="EditEditAccountAction"/>
<menuitem name="EditDeleteAccount" action="EditDeleteAccountAction"/>
<menuitem name="EditAccountFindAccount" action="EditFindAccountAction"/>
<menuitem name="AccountCascadeProperty" action="EditCascadeAccountAction"/>
<menuitem name="EditRenumberSubaccounts" action="EditRenumberSubaccountsAction"/>
<separator name="EditSep2"/>
<menuitem name="FileOpenAccount" action="FileOpenAccountAction"/>
<menuitem name="FileOpenSubaccounts" action="FileOpenSubaccountsAction"/>
</placeholder>
</menu>
<menu name="Actions" action="ActionsAction">
<placeholder name="ActionsPlaceholder">
<separator name="ActionsSep1"/>
<menuitem name="FileNewAccount" action="FileNewAccountAction"/>
<menuitem name="FileAddAccountHierarchyAssistant" action="FileAddAccountHierarchyAssistantAction"/>
<separator name="ActionsSep2"/>
<menuitem name="ActionsTransfer" action="ActionsTransferAction"/>
<menuitem name="ActionsReconcile" action="ActionsReconcileAction"/>
<menuitem name="ActionsAutoClear" action="ActionsAutoClearAction"/>
<menuitem name="ActionsStockSplit" action="ActionsStockSplitAction"/>
<menuitem name="ActionLots" action="ActionsLotsAction"/>
<separator name="ActionsSep3"/>
<menu name="ScrubMenu" action="ScrubMenuAction">
<menuitem name="Scrub" action="ScrubAction"/>
<menuitem name="ScrubSub" action="ScrubSubAction"/>
<menuitem name="ScrubAll" action="ScrubAllAction"/>
</menu>
</placeholder>
</menu>
<menu name="Extensions" action="ExtensionsAction">
<placeholder name="ExtensionsPlaceholder"/>
</menu>
</menubar>
<popup name="MainPopup" action="FakeToplevel">
<placeholder name="PopupPlaceholder1">
<menuitem name="ViewFilterBy" action="ViewFilterByAction"/>
</placeholder>
<placeholder name="PopupPlaceholder2">
<menuitem name="AccountOpenAccount" action="FileOpenAccountAction"/>
<menuitem name="AccountOpenSubaccounts" action="FileOpenSubaccountsAction"/>
<menuitem name="AccountEditAccount" action="EditEditAccountAction"/>
<menuitem name="AccountCascadeProperty" action="EditCascadeAccountAction"/>
<menuitem name="AccountFindAccountPopup" action="EditFindAccountPopupAction"/>
<separator name="AccountSep1"/>
<menuitem name="AccountReconcile" action="ActionsReconcileAction"/>
<menuitem name="AccountAutoClear" action="ActionsAutoClearAction"/>
<menuitem name="AccountTransfer" action="ActionsTransferAction"/>
<menuitem name="AccountStockSplit" action="ActionsStockSplitAction"/>
<menuitem name="AccountLots" action="ActionsLotsAction"/>
<separator name="AccountSep2"/>
<menuitem name="AccountNewAccount" action="FileNewAccountAction"/>
<menuitem name="AccountDeleteAccount" action="EditDeleteAccountAction"/>
<separator name="AccountSep3"/>
</placeholder>
<placeholder name="PopupBottomPlaceholder">
<menu name="ScrubMenu" action="ScrubMenuAction">
<menuitem name="Scrub" action="ScrubAction"/>
<menuitem name="ScrubSub" action="ScrubSubAction"/>
<menuitem name="ScrubAll" action="ScrubAllAction"/>
</menu>
</placeholder>
</popup>
<toolbar name="DefaultToolbar">
<placeholder name="DefaultToolbarPlaceholder">
<separator name="ToolbarSep2"/>
<toolitem name="ToolbarOpenAccount" action="FileOpenAccountAction"/>
<toolitem name="ToolbarEditAccount" action="EditEditAccountAction"/>
<separator name="ToolbarSep3"/>
<toolitem name="ToolbarNewAccount" action="FileNewAccountAction"/>
<toolitem name="ToolbarDeleteAccount" action="EditDeleteAccountAction"/>
</placeholder>
</toolbar>
</ui>

View File

@ -0,0 +1,444 @@
<?xml version="1.0"?>
<interface>
<menu id="FilePlaceholder3">
<item>
<attribute name="label" translatable="yes">_Print</attribute>
<attribute name="action">mainwin.FilePrintAction</attribute>
<attribute name="accel">&lt;Primary&gt;p</attribute>
<attribute name="tooltip" translatable="yes">Print the currently active page</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
</menu>
<menu id="EditPlaceholder1">
<item>
<attribute name="label" translatable="yes">_Edit Account</attribute>
<attribute name="action">GncPluginPageAccountTreeActions.EditEditAccountAction</attribute>
<attribute name="accel">&lt;Primary&gt;e</attribute>
<attribute name="tooltip" translatable="yes">Edit the selected account</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Delete Account</attribute>
<attribute name="action">GncPluginPageAccountTreeActions.EditDeleteAccountAction</attribute>
<attribute name="accel">Delete</attribute>
<attribute name="tooltip" translatable="yes">Edit the selected account</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
<item>
<attribute name="label" translatable="yes">F_ind Account</attribute>
<attribute name="action">GncPluginPageAccountTreeActions.EditFindAccountAction</attribute>
<attribute name="accel">&lt;Primary&gt;i</attribute>
<attribute name="tooltip" translatable="yes">Find an account</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Cascade Account Properties...</attribute>
<attribute name="action">GncPluginPageAccountTreeActions.EditCascadeAccountAction</attribute>
<attribute name="tooltip" translatable="yes">Cascade selected properties for account</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Renumber Subaccounts...</attribute>
<attribute name="action">GncPluginPageAccountTreeActions.EditRenumberSubaccountsAction</attribute>
<attribute name="tooltip" translatable="yes">Renumber the children of the selected account</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
</menu>
<menu id="EditPlaceholder2">
<item>
<attribute name="label" translatable="yes">Open _Account</attribute>
<attribute name="action">GncPluginPageAccountTreeActions.EditOpenAccountAction</attribute>
<attribute name="tooltip" translatable="yes">Open the selected account</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Open _SubAccounts</attribute>
<attribute name="action">GncPluginPageAccountTreeActions.EditOpenSubaccountsAction</attribute>
<attribute name="tooltip" translatable="yes">Open the selected account and all its subaccounts</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
</menu>
<menu id="EditPlaceholder3">
<item>
<attribute name="label" translatable="yes">_Find...</attribute>
<attribute name="action">gnc-plugin-basic-commands-actions.EditFindTransactionsAction</attribute>
<attribute name="accel">&lt;Primary&gt;f</attribute>
<attribute name="tooltip" translatable="yes">Find transactions with a search</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
</menu>
<menu id="EditPlaceholder5">
<item>
<!-- Translators: remember to reuse this translation in dialog-account.glade -->
<attribute name="label" translatable="yes">Ta_x Report Options</attribute>
<attribute name="action">GncPluginPageAccountTreeActions.EditTaxOptionsAction</attribute>
<!-- Translators: currently implemented are, US: income tax and DE: VAT, So adjust this string -->
<attribute name="tooltip" translatable="yes">Setup relevant accounts for tax reports, e.g. US income tax</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
</menu>
<menu id="ViewPlaceholder1">
<item>
<attribute name="label" translatable="yes">_Filter By...</attribute>
<attribute name="action">GncPluginPageAccountTreeActions.ViewFilterByAction</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
</menu>
<menu id="ViewPlaceholder4">
<item>
<attribute name="label" translatable="yes">_Refresh</attribute>
<attribute name="action">GncPluginPageAccountTreeActions.ViewRefreshAction</attribute>
<attribute name="accel">&lt;Primary&gt;r</attribute>
<attribute name="tooltip" translatable="yes">Refresh this window</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
</menu>
<menu id="ActionsPlaceholder4">
<item>
<attribute name="label" translatable="yes">New _Account...</attribute>
<attribute name="action">GncPluginPageAccountTreeActions.FileNewAccountAction</attribute>
<attribute name="tooltip" translatable="yes">Create a new Account</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
<item>
<attribute name="label" translatable="yes">New Account _Hierarchy...</attribute>
<attribute name="action">GncPluginPageAccountTreeActions.FileAddAccountHierarchyAssistantAction</attribute>
<attribute name="tooltip" translatable="yes">Extend the current book by merging with new account type categories</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
</menu>
<menu id="ActionsPlaceholder5">
<item>
<attribute name="label" translatable="yes">_Transfer...</attribute>
<attribute name="action">GncPluginPageAccountTreeActions.ActionsTransferAction</attribute>
<attribute name="accel">&lt;Primary&gt;t</attribute>
<attribute name="tooltip" translatable="yes">Transfer funds from one account to another</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Reconcile...</attribute>
<attribute name="action">GncPluginPageAccountTreeActions.ActionsReconcileAction</attribute>
<attribute name="tooltip" translatable="yes">Reconcile the selected account</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Auto-clear...</attribute>
<attribute name="action">GncPluginPageAccountTreeActions.ActionsAutoClearAction</attribute>
<attribute name="tooltip" translatable="yes">Automatically clear individual transactions, so as to reach a certain cleared amount</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
<item>
<attribute name="label" translatable="no">Stock Ass_istant</attribute>
<attribute name="action">GncPluginPageAccountTreeActions.ActionsStockAssistantAction</attribute>
<attribute name="tooltip" translatable="yes">Stock Assistant</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Stoc_k Split...</attribute>
<attribute name="action">GncPluginPageAccountTreeActions.ActionsStockSplitAction</attribute>
<attribute name="tooltip" translatable="yes">Record a stock split or a stock merger</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
<item>
<attribute name="label" translatable="yes">View _Lots...</attribute>
<attribute name="action">GncPluginPageAccountTreeActions.ActionsLotsAction</attribute>
<attribute name="tooltip" translatable="yes">Bring up the lot viewer/editor window</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
</menu>
<menu id="ActionsPlaceholder6">
<submenu>
<attribute name="label" translatable="yes">_Check &amp; Repair</attribute>
<attribute name="action">mainwin.ScrubMenuAction</attribute>
<attribute name="temp" translatable="no">yes</attribute>
<item>
<attribute name="label" translatable="yes">Check &amp; Repair A_ccount</attribute>
<attribute name="action">GncPluginPageAccountTreeActions.ScrubAction</attribute>
<attribute name="tooltip" translatable="yes">Check for and repair unbalanced transactions and orphan splits in this account</attribute>
<attribute name="tempx" translatable="no">yes</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Check &amp; Repair Su_baccounts</attribute>
<attribute name="action">GncPluginPageAccountTreeActions.ScrubSubAction</attribute>
<attribute name="tooltip" translatable="yes">Check for and repair unbalanced transactions and orphan splits in this account and its subaccounts</attribute>
<attribute name="tempx" translatable="no">yes</attribute>
</item>
<item>
<attribute name="label" translatable="no">Check &amp; Repair A_ll</attribute>
<attribute name="action">GncPluginPageAccountTreeActions.ScrubAllAction</attribute>
<attribute name="tooltip" translatable="yes">Check for and repair unbalanced transactions and orphan splits in all accounts</attribute>
<attribute name="tempx" translatable="no">yes</attribute>
</item>
</submenu>
</menu>
<menu id="mainwin-popup">
<section>
<item>
<attribute name="label" translatable="yes">_Filter By...</attribute>
<attribute name="action">GncPluginPageAccountTreeActions.ViewFilterByAction</attribute>
<attribute name="tooltip" translatable="yes">Filter accounts</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>
<section>
<item>
<attribute name="label" translatable="yes">Open _Account</attribute>
<attribute name="action">GncPluginPageAccountTreeActions.EditOpenAccountAction</attribute>
<attribute name="tooltip" translatable="yes">Open the selected account</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Open _SubAccounts</attribute>
<attribute name="action">GncPluginPageAccountTreeActions.EditOpenSubaccountsAction</attribute>
<attribute name="tooltip" translatable="yes">Open the selected account and all its subaccounts</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Edit _Account</attribute>
<attribute name="action">GncPluginPageAccountTreeActions.EditEditAccountAction</attribute>
<attribute name="tooltip" translatable="yes">Edit the selected account</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Cascade Account Properties...</attribute>
<attribute name="action">GncPluginPageAccountTreeActions.EditCascadeAccountAction</attribute>
<attribute name="tooltip" translatable="yes">Cascade selected properties for account</attribute>
</item>
<item>
<attribute name="label" translatable="yes">F_ind Account</attribute>
<attribute name="action">GncPluginPageAccountTreeActions.EditFindAccountPopupAction</attribute>
<attribute name="tooltip" translatable="yes">Find an account</attribute>
</item>
</section>
<section>
<item>
<attribute name="label" translatable="yes">_Reconcile...</attribute>
<attribute name="action">GncPluginPageAccountTreeActions.ActionsReconcileAction</attribute>
<attribute name="tooltip" translatable="yes">Reconcile the selected account</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Auto-clear...</attribute>
<attribute name="action">GncPluginPageAccountTreeActions.ActionsAutoClearAction</attribute>
<attribute name="tooltip" translatable="yes">Automatically clear individual transactions, given a cleared amount</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Transfer...</attribute>
<attribute name="action">GncPluginPageAccountTreeActions.ActionsTransferAction</attribute>
<attribute name="tooltip" translatable="yes">Transfer funds from one account to another</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Stoc_k Split...</attribute>
<attribute name="action">GncPluginPageAccountTreeActions.ActionsStockSplitAction</attribute>
<attribute name="tooltip" translatable="yes">Record a stock split or a stock merger</attribute>
</item>
<item>
<attribute name="label" translatable="yes">View _Lots...</attribute>
<attribute name="action">GncPluginPageAccountTreeActions.ActionsLotsAction</attribute>
<attribute name="tooltip" translatable="yes">Bring up the lot viewer/editor window</attribute>
</item>
</section>
<section>
<item>
<attribute name="label" translatable="yes">New _Account...</attribute>
<attribute name="action">GncPluginPageAccountTreeActions.FileNewAccountAction</attribute>
<attribute name="tooltip" translatable="yes">Create a new Account</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Delete Account...</attribute>
<attribute name="action">GncPluginPageAccountTreeActions.EditDeleteAccountAction</attribute>
<attribute name="tooltip" translatable="yes">Delete selected account</attribute>
</item>
</section>
<section>
<submenu>
<attribute name="label" translatable="yes">_Check &amp; Repair</attribute>
<attribute name="action">GncPluginPageAccountTreeActions.ScrubMenuAction</attribute>
<item>
<attribute name="label" translatable="yes">_Check &amp; Repair A_ccount</attribute>
<attribute name="action">GncPluginPageAccountTreeActions.ScrubAction</attribute>
<attribute name="tooltip" translatable="yes">Check for and repair unbalanced transactions and orphan splits in this account</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Check &amp; Repair Su_baccounts</attribute>
<attribute name="action">GncPluginPageAccountTreeActions.ScrubSubAction</attribute>
<attribute name="tooltip" translatable="yes">Check for and repair unbalanced transactions and orphan splits in this account and its subaccounts</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Check &amp; Repair A_ll</attribute>
<attribute name="action">GncPluginPageAccountTreeActions.ScrubAllAction</attribute>
<attribute name="tooltip" translatable="yes">Check for and repair unbalanced transactions and orphan splits in all accounts</attribute>
</item>
</submenu>
</section>
</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="label" translatable="yes">_Save</property>
<property name="action-name">gnc-plugin-basic-commands-actions.FileSaveAction</property>
<property name="tooltip-text" translatable="yes">Save the current file</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="label" translatable="yes">_Close</property>
<property name="action-name">mainwin.FileCloseAction</property>
<property name="tooltip-text" translatable="yes">Close the currently active page</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="label" translatable="yes">New _Invoice...</property>
<property name="action-name">gnc-plugin-business-actions.ToolbarNewInvoiceAction</property>
<property name="tooltip-text" translatable="yes">Open the New Invoice dialog</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>
<child>
<object class="GtkToolButton" id="but3">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Open _Account</property>
<property name="action-name">GncPluginPageAccountTreeActions.EditOpenAccountAction</property>
<property name="tooltip-text" translatable="yes">Open the selected account</property>
<property name="use-underline">True</property>
<property name="icon-name">gnc-account-open</property>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
<object class="GtkToolButton" id="but4">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Edit _Account</property>
<property name="action-name">GncPluginPageAccountTreeActions.EditEditAccountAction</property>
<property name="tooltip-text" translatable="yes">Edit the selected account</property>
<property name="use-underline">True</property>
<property name="icon-name">gnc-account-edit</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="but5">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">New _Account...</property>
<property name="action-name">GncPluginPageAccountTreeActions.FileNewAccountAction</property>
<property name="tooltip-text" translatable="yes">Create a new Account</property>
<property name="use-underline">True</property>
<property name="icon-name">gnc-account-new</property>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
<object class="GtkToolButton" id="but6">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">_Delete Account...</property>
<property name="action-name">GncPluginPageAccountTreeActions.EditDeleteAccountAction</property>
<property name="tooltip-text" translatable="yes">Delete selected account</property>
<property name="use-underline">True</property>
<property name="icon-name">gnc-account-delete</property>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
</object>
</interface>

View File

@ -1,37 +0,0 @@
<ui>
<menubar>
<menu name="Edit" action="EditAction">
<placeholder name="EditSelectedPlaceholder">
<menuitem name="Estimate" action="EstimateBudgetAction"/>
<menuitem name="AllPeriods" action="AllPeriodsBudgetAction"/>
<menuitem name="Delete" action="DeleteBudgetAction"/>
<menuitem name="Note" action="BudgetNoteAction"/>
<menuitem name="Report" action="BudgetReportAction"/>
</placeholder>
<menuitem name="Options" action="OptionsBudgetAction"/>
</menu>
</menubar>
<popup name="MainPopup" action="FakeToplevel">
<placeholder name="PopupPlaceholder1">
<menuitem name="Options" action="OptionsBudgetAction"/>
</placeholder>
<placeholder name="PopupPlaceholder2">
<menuitem name="Note" action="BudgetNoteAction"/>
</placeholder>
</popup>
<toolbar name="DefaultToolbar">
<placeholder name="DefaultToolbarPlaceholder">
<toolitem name="OpenAccount" action="OpenAccountAction"/>
<separator name="ToolbarSep3"/>
<toolitem name="Options" action="OptionsBudgetAction"/>
<separator name="ToolbarSep4"/>
<toolitem name="Estimate" action="EstimateBudgetAction"/>
<toolitem name="AllPeriods" action="AllPeriodsBudgetAction"/>
<toolitem name="Delete" action="DeleteBudgetAction"/>
<toolitem name="Note" action="BudgetNoteAction"/>
<toolitem name="Report" action="BudgetReportAction"/>
</placeholder>
</toolbar>
</ui>

View File

@ -0,0 +1,298 @@
<?xml version="1.0"?>
<interface>
<menu id="FilePlaceholder3">
<item>
<attribute name="label" translatable="yes">_Print</attribute>
<attribute name="action">mainwin.FilePrintAction</attribute>
<attribute name="accel">&lt;Primary&gt;p</attribute>
<attribute name="tooltip" translatable="yes">Print the currently active page</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
</menu>
<menu id="EditPlaceholder1">
<item>
<attribute name="label" translatable="yes">Esti_mate Budget...</attribute>
<attribute name="action">GncPluginPageBudgetActions.EstimateBudgetAction</attribute>
<attribute name="tooltip" translatable="yes">Edit the selected account</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_All Periods...</attribute>
<attribute name="action">GncPluginPageBudgetActions.AllPeriodsBudgetAction</attribute>
<attribute name="tooltip" translatable="yes">Estimate a budget value for the selected accounts from past transactions</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Delete Budget...</attribute>
<attribute name="action">GncPluginPageBudgetActions.DeleteBudgetAction</attribute>
<attribute name="tooltip" translatable="yes">Select this or another budget and delete it</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Edit Note</attribute>
<attribute name="action">GncPluginPageBudgetActions.BudgetNoteAction</attribute>
<attribute name="tooltip" translatable="yes">Edit note for the selected account and period</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Budget Report</attribute>
<attribute name="action">GncPluginPageBudgetActions.BudgetReportAction</attribute>
<attribute name="tooltip" translatable="yes">Run the budget report</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
</menu>
<menu id="EditPlaceholder3">
<item>
<attribute name="label" translatable="yes">_Find...</attribute>
<attribute name="action">gnc-plugin-basic-commands-actions.EditFindTransactionsAction</attribute>
<attribute name="accel">&lt;Primary&gt;f</attribute>
<attribute name="tooltip" translatable="yes">Find transactions with a search</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
</menu>
<menu id="EditPlaceholder5">
<item>
<!-- Translators: remember to reuse this translation in dialog-account.glade -->
<attribute name="label" translatable="yes">Ta_x Report Options</attribute>
<attribute name="action">GncPluginPageBudgetActions.EditTaxOptionsAction</attribute>
<!-- Translators: currently implemented are, US: income tax and DE: VAT, So adjust this string -->
<attribute name="tooltip" translatable="yes">Setup relevant accounts for tax reports, e.g. US income tax</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
</menu>
<menu id="EditPlaceholder6">
<item>
<attribute name="label" translatable="yes">Budget _Options...</attribute>
<attribute name="action">GncPluginPageBudgetActions.OptionsBudgetAction</attribute>
<attribute name="tooltip" translatable="yes">Edit this budget's options</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
</menu>
<menu id="ViewPlaceholder1">
<item>
<attribute name="label" translatable="yes">_Filter By...</attribute>
<attribute name="action">GncPluginPageBudgetActions.ViewFilterByAction</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
</menu>
<menu id="ViewPlaceholder4">
<item>
<attribute name="label" translatable="yes">_Refresh</attribute>
<attribute name="action">GncPluginPageBudgetActions.ViewRefreshAction</attribute>
<attribute name="accel">&lt;Primary&gt;r</attribute>
<attribute name="tooltip" translatable="yes">Refresh this window</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
</menu>
<menu id="mainwin-popup">
<item>
<attribute name="label" translatable="no">_Test</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="label" translatable="yes">_Save</property>
<property name="action-name">gnc-plugin-basic-commands-actions.FileSaveAction</property>
<property name="tooltip-text" translatable="yes">Save the current file</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="label" translatable="yes">_Close</property>
<property name="action-name">mainwin.FileCloseAction</property>
<property name="tooltip-text" translatable="yes">Close the currently active page</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="label" translatable="yes">New _Invoice...</property>
<property name="action-name">gnc-plugin-business-actions.ToolbarNewInvoiceAction</property>
<property name="tooltip-text" translatable="yes">Open the New Invoice dialog</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>
<child>
<object class="GtkToolButton" id="but3">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Open _Account</property>
<property name="action-name">GncPluginPageBudgetActions.EditOpenAccountAction</property>
<property name="tooltip-text" translatable="yes">Open the selected account</property>
<property name="use-underline">True</property>
<property name="icon-name">gnc-account-open</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="but4">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Budget _Options...</property>
<property name="action-name">GncPluginPageBudgetActions.OptionsBudgetAction</property>
<property name="tooltip-text" translatable="yes">Edit this budget's options</property>
<property name="use-underline">True</property>
<property name="icon-name">document-properties</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="but5">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Esti_mate Budget...</property>
<property name="action-name">GncPluginPageBudgetActions.EstimateBudgetAction</property>
<property name="tooltip-text" translatable="yes">Estimate a budget value for the selected accounts from past transactions</property>
<property name="use-underline">True</property>
<property name="icon-name">system-run</property>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
<object class="GtkToolButton" id="but6">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">_All Periods...</property>
<property name="action-name">GncPluginPageBudgetActions.AllPeriodsBudgetAction</property>
<property name="tooltip-text" translatable="yes">Edit budget for all periods for the selected accounts</property>
<property name="use-underline">True</property>
<property name="icon-name">system-run</property>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
<object class="GtkToolButton" id="but7">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">_Delete Budget...</property>
<property name="action-name">GncPluginPageBudgetActions.DeleteBudgetAction</property>
<property name="tooltip-text" translatable="yes">Select this or another budget and delete it</property>
<property name="use-underline">True</property>
<property name="icon-name">gnc-account-delete</property>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
<object class="GtkToolButton" id="but8">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Edit Note</property>
<property name="action-name">GncPluginPageBudgetActions.BudgetNoteAction</property>
<property name="tooltip-text" translatable="yes">Edit note for the selected account and period</property>
<property name="use-underline">True</property>
<property name="icon-name">text-x-generic</property>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
<object class="GtkToolButton" id="but9">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Budget Report</property>
<property name="action-name">GncPluginPageBudgetActions.BudgetReportAction</property>
<property name="tooltip-text" translatable="yes">Run the budget report</property>
<property name="use-underline">True</property>
<property name="icon-name">system-run</property>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
</object>
</interface>

View File

@ -1,97 +0,0 @@
<ui>
<menubar>
<menu name="Edit" action="EditAction">
<placeholder name="EditSelectedPlaceholder">
<menuitem name="EditEditInvoice" action="EditEditInvoiceAction"/>
<menuitem name="EditDuplicateInvoice" action="EditDuplicateInvoiceAction"/>
<menuitem name="EditPostInvoice" action="EditPostInvoiceAction"/>
<menuitem name="EditUnpostInvoice" action="EditUnpostInvoiceAction"/>
</placeholder>
</menu>
<menu name="View" action="ViewAction">
<placeholder name="ViewPlaceholder">
<separator name="ViewSep44"/>
<menuitem name="ViewSaveLayout" action="ViewSaveLayoutAction"/>
<menuitem name="ViewResetLayout" action="ViewResetLayoutAction"/>
<separator name="ViewSep45"/>
<menu name="SortOrder" action="SortOrderAction">
<menuitem name="SortStandard" action="SortStandardAction"/>
<separator name="ViewSep43"/>
<menuitem name="SortDate" action="SortDateAction"/>
<menuitem name="SortDateEntry" action="SortDateEntryAction"/>
<menuitem name="SortQuantity" action="SortQuantityAction"/>
<menuitem name="SortPrice" action="SortPriceAction"/>
<menuitem name="SortDescription" action="SortDescriptionAction"/>
</menu>
</placeholder>
</menu>
<menu name="Actions" action="ActionsAction">
<placeholder name="ActionsPlaceholder">
<menuitem name="RecordEntry" action="RecordEntryAction"/>
<menuitem name="CancelEntry" action="CancelEntryAction"/>
<menuitem name="DeleteEntry" action="DeleteEntryAction"/>
<menuitem name="BlankEntry" action="BlankEntryAction"/>
<separator name="ActionsSep4"/>
<menuitem name="DuplicateEntry" action="DuplicateEntryAction"/>
<menuitem name="UpEntry" action="EntryUpAction"/>
<menuitem name="DownEntry" action="EntryDownAction"/>
</placeholder>
</menu>
<placeholder name="AdditionalMenusPlaceholder">
<menu name="Business" action="BusinessAction">
<placeholder name="BusinessPlaceholderMiddle">
<separator name="BusinessSep1"/>
<menuitem name="BusinessLink" action="BusinessLinkAction"/>
<menuitem name="BusinessLinkOpen" action="BusinessLinkOpenAction"/>
<separator name="BusinessSep2"/>
<menuitem name="ToolsProcessPayment" action="ToolsProcessPaymentAction"/>
</placeholder>
</menu>
</placeholder>
<menu name="Reports" action="ReportsAction">
<placeholder name="ReportsPlaceholder">
<menuitem name="ReportsCompanyReport" action="ReportsCompanyReportAction"/>
</placeholder>
</menu>
</menubar>
<toolbar name="DefaultToolbar">
<placeholder name="ToolbarSavePlaceholder">
<toolitem name="ToolbarPrintInvoice" action="FilePrintAction"/>
</placeholder>
<placeholder name="DefaultToolbarPlaceholder">
<toolitem name="ToolbarNewInvoice" action="BusinessNewInvoiceAction"/>
<toolitem name="ToolbarEditInvoice" action="EditEditInvoiceAction"/>
<toolitem name="ToolbarDuplicateInvoice" action="EditDuplicateInvoiceAction"/>
<separator name="ToolbarSep65"/>
<toolitem name="ToolbarRecordEntry" action="RecordEntryAction"/>
<toolitem name="ToolbarCancelEntry" action="CancelEntryAction"/>
<toolitem name="ToolbarDeleteEntry" action="DeleteEntryAction"/>
<toolitem name="ToolbarDuplicateEntry" action="DuplicateEntryAction"/>
<toolitem name="ToolbarUpEntry" action="EntryUpAction"/>
<toolitem name="ToolbarDownEntry" action="EntryDownAction"/>
<toolitem name="ToolbarBlankEntry" action="BlankEntryAction"/>
<separator name="ToolbarSep68"/>
<toolitem name="ToolbarPostInvoice" action="EditPostInvoiceAction"/>
<toolitem name="ToolbarUnPostInvoice" action="EditUnpostInvoiceAction"/>
<toolitem name="ToolbarProcessPayment" action="ToolsProcessPaymentAction"/>
</placeholder>
</toolbar>
<popup name="MainPopup" action="FakeToplevel">
<placeholder name="PopupPlaceholder2">
<menuitem name="RecordEntry" action="RecordEntryAction"/>
<menuitem name="CancelEntry" action="CancelEntryAction"/>
<menuitem name="DeleteEntry" action="DeleteEntryAction"/>
<separator name="PopupSep1"/>
<menuitem name="DuplicateEntry" action="DuplicateEntryAction"/>
<menuitem name="UpEntry" action="EntryUpAction"/>
<menuitem name="DownEntry" action="EntryDownAction"/>
<menuitem name="BlankEntry" action="BlankEntryAction"/>
</placeholder>
</popup>
</ui>

View File

@ -0,0 +1,566 @@
<?xml version="1.0"?>
<interface>
<menu id="FilePlaceholder3">
<item>
<attribute name="label" translatable="yes">_Print</attribute>
<attribute name="action">GncPluginPageInvoiceActions.FilePrintAction</attribute>
<attribute name="accel">&lt;Primary&gt;p</attribute>
<attribute name="tooltip" translatable="yes">Print the currently active page</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
</menu>
<menu id="EditPlaceholder1">
<item>
<attribute name="label" translatable="no">EditEditInvoiceAction</attribute>
<attribute name="action">GncPluginPageInvoiceActions.EditEditInvoiceAction</attribute>
<attribute name="tooltip" translatable="yes">Edit this invoice</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
<item>
<attribute name="label" translatable="no">EditDuplicateInvoiceAction</attribute>
<attribute name="action">GncPluginPageInvoiceActions.EditDuplicateInvoiceAction</attribute>
<attribute name="tooltip" translatable="yes">Create a new invoice as a duplicate of the current one</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
<item>
<attribute name="label" translatable="no">EditPostInvoiceAction</attribute>
<attribute name="action">GncPluginPageInvoiceActions.EditPostInvoiceAction</attribute>
<attribute name="tooltip" translatable="yes">Post this invoice to your Chart of Accounts</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
<item>
<attribute name="label" translatable="no">EditUnpostInvoiceAction</attribute>
<attribute name="action">GncPluginPageInvoiceActions.EditUnpostInvoiceAction</attribute>
<attribute name="tooltip" translatable="yes">Unpost this invoice and make it editable</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
</menu>
<menu id="EditPlaceholder3">
<item>
<attribute name="label" translatable="yes">_Find...</attribute>
<attribute name="action">gnc-plugin-basic-commands-actions.EditFindTransactionsAction</attribute>
<attribute name="accel">&lt;Primary&gt;f</attribute>
<attribute name="tooltip" translatable="yes">Find transactions with a search</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
</menu>
<menu id="EditPlaceholder5">
<item>
<!-- Translators: remember to reuse this translation in dialog-account.glade -->
<attribute name="label" translatable="yes">Ta_x Report Options</attribute>
<attribute name="action">GncPluginPageAccountTreeActions.EditTaxOptionsAction</attribute>
<!-- Translators: currently implemented are, US: income tax and DE: VAT, So adjust this string -->
<attribute name="tooltip" translatable="yes">Setup relevant accounts for tax reports, e.g. US income tax</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
</menu>
<menu id="ViewPlaceholder1">
<item>
<attribute name="label" translatable="no">ViewSaveLayoutAction</attribute>
<attribute name="action">GncPluginPageInvoiceActions.ViewSaveLayoutAction</attribute>
<attribute name="tooltip" translatable="yes">Use the current layout as default for all customer invoices and credit notes</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
<item>
<attribute name="label" translatable="no">ViewResetLayoutAction</attribute>
<attribute name="action">GncPluginPageInvoiceActions.ViewResetLayoutAction</attribute>
<attribute name="tooltip" translatable="yes">Reset default layout for all customer invoices and credit notes back to built-in defaults and update the current page accordingly</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
</menu>
<menu id="ViewPlaceholder2">
<submenu>
<attribute name="label" translatable="yes">Sort _Order</attribute>
<attribute name="action">GncPluginPageInvoiceActions.SortOrderAction</attribute>
<attribute name="temp" translatable="no">yes</attribute>
<section>
<item>
<attribute name="label" translatable="yes">_Standard</attribute>
<attribute name="action">GncPluginPageInvoiceActions.SortOrderRadioAction</attribute>
<attribute name="target" type="i">0</attribute>
<attribute name="tempx" translatable="no">yes</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Date</attribute>
<attribute name="action">GncPluginPageInvoiceActions.SortOrderRadioAction</attribute>
<attribute name="target" type="i">1</attribute>
<attribute name="tempx" translatable="no">yes</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Date of _Entry</attribute>
<attribute name="action">GncPluginPageInvoiceActions.SortOrderRadioAction</attribute>
<attribute name="target" type="i">2</attribute>
<attribute name="tempx" translatable="no">yes</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Quantity</attribute>
<attribute name="action">GncPluginPageInvoiceActions.SortOrderRadioAction</attribute>
<attribute name="target" type="i">4</attribute>
<attribute name="tempx" translatable="no">yes</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Price</attribute>
<attribute name="action">GncPluginPageInvoiceActions.SortOrderRadioAction</attribute>
<attribute name="target" type="i">5</attribute>
<attribute name="tempx" translatable="no">yes</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Descri_ption</attribute>
<attribute name="action">GncPluginPageInvoiceActions.SortOrderRadioAction</attribute>
<attribute name="target" type="i">3</attribute>
<attribute name="tempx" translatable="no">yes</attribute>
</item>
</section>
</submenu>
</menu>
<menu id="ViewPlaceholder4">
<item>
<attribute name="label" translatable="yes">_Refresh</attribute>
<attribute name="action">GncPluginPageInvoiceActions.ViewRefreshAction</attribute>
<attribute name="accel">&lt;Primary&gt;r</attribute>
<attribute name="tooltip" translatable="yes">Refresh this window</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
</menu>
<menu id="ActionsPlaceholder4">
<item>
<attribute name="label" translatable="yes">_Enter</attribute>
<attribute name="action">GncPluginPageInvoiceActions.RecordEntryAction</attribute>
<attribute name="tooltip" translatable="yes">Record the current entry</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Cancel</attribute>
<attribute name="action">GncPluginPageInvoiceActions.CancelEntryAction</attribute>
<attribute name="tooltip" translatable="yes">Cancel the current entry</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Delete</attribute>
<attribute name="action">GncPluginPageInvoiceActions.DeleteEntryAction</attribute>
<attribute name="tooltip" translatable="yes">Delete the current entry</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Blank</attribute>
<attribute name="action">GncPluginPageInvoiceActions.BlankEntryAction</attribute>
<attribute name="tooltip" translatable="yes">Move to the blank entry at the bottom</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
</menu>
<menu id="ActionsPlaceholder5">
<item>
<attribute name="label" translatable="yes">Dup_licate Entry</attribute>
<attribute name="action">GncPluginPageInvoiceActions.DuplicateEntryAction</attribute>
<attribute name="tooltip" translatable="yes">Make a copy of the current entry</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Move Entry _Up</attribute>
<attribute name="action">GncPluginPageInvoiceActions.EntryUpAction</attribute>
<attribute name="tooltip" translatable="yes">Move the current entry one row upwards</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Move Entry Do_wn</attribute>
<attribute name="action">GncPluginPageInvoiceActions.EntryDownAction</attribute>
<attribute name="tooltip" translatable="yes">Move the current entry one row downwards</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
</menu>
<menu id="BusinessPlaceholder2">
<item>
<attribute name="label" translatable="no">BusinessLinkAction</attribute>
<attribute name="action">GncPluginPageInvoiceActions.BusinessLinkAction</attribute>
<attribute name="tooltip" translatable="yes">Manage link of an external document to this item</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
<item>
<attribute name="label" translatable="no">BusinessLinkOpenAction</attribute>
<attribute name="action">GncPluginPageInvoiceActions.BusinessLinkOpenAction</attribute>
<attribute name="tooltip" translatable="yes">Open the linked document</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
</menu>
<menu id="BusinessPlaceholder3">
<item>
<attribute name="label" translatable="no">ToolsProcessPaymentAction</attribute>
<attribute name="action">GncPluginPageInvoiceActions.ToolsProcessPaymentAction</attribute>
<attribute name="tooltip" translatable="yes">Enter a payment for the owner of this invoice</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
</menu>
<menu id="ReportsPlaceholder1">
<item>
<attribute name="label" translatable="no">_Company Report</attribute>
<attribute name="action">GncPluginPageInvoiceActions.ReportsCompanyReportAction</attribute>
<attribute name="tooltip" translatable="yes">Open a company report window for the owner of this invoice</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
</menu>
<menu id="mainwin-popup">
<section>
<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>
<section>
<item>
<attribute name="label" translatable="yes">_Enter</attribute>
<attribute name="action">GncPluginPageInvoiceActions.RecordEntryAction</attribute>
<attribute name="tooltip" translatable="yes">Record the current entry</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Cancel</attribute>
<attribute name="action">GncPluginPageInvoiceActions.CancelEntryAction</attribute>
<attribute name="tooltip" translatable="yes">Cancel the current entry</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Delete</attribute>
<attribute name="action">GncPluginPageInvoiceActions.DeleteEntryAction</attribute>
<attribute name="tooltip" translatable="yes">Delete the current entry</attribute>
</item>
</section>
<section>
<item>
<attribute name="label" translatable="yes">Dup_licate Entry</attribute>
<attribute name="action">GncPluginPageInvoiceActions.DuplicateEntryAction</attribute>
<attribute name="tooltip" translatable="yes">Make a copy of the current entry</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Move Entry _Up</attribute>
<attribute name="action">GncPluginPageInvoiceActions.EntryUpAction</attribute>
<attribute name="tooltip" translatable="yes">Move the current entry one row upwards</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Move Entry Do_wn</attribute>
<attribute name="action">GncPluginPageInvoiceActions.EntryDownAction</attribute>
<attribute name="tooltip" translatable="yes">Move the current entry one row downwards</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Blank</attribute>
<attribute name="action">GncPluginPageInvoiceActions.BlankEntryAction</attribute>
<attribute name="tooltip" translatable="yes">Move to the blank entry at the bottom of the Invoice</attribute>
</item>
</section>
</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="label" translatable="yes">_Save</property>
<property name="action-name">gnc-plugin-basic-commands-actions.FileSaveAction</property>
<property name="tooltip-text" translatable="yes">Save the current file</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="label" translatable="yes">_Print Invoice</property>
<property name="action-name">gnc-plugin-business-actions.FilePrintAction</property>
<property name="tooltip-text" translatable="yes">Make a printable invoice</property>
<property name="use-underline">True</property>
<property name="icon-name">document-print</property>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
<object class="GtkToolButton" id="but3">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">_Close</property>
<property name="action-name">mainwin.FileCloseAction</property>
<property name="tooltip-text" translatable="yes">Close the currently active page</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="but4">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">New _Invoice...</property>
<property name="action-name">gnc-plugin-business-actions.ToolbarNewInvoiceAction</property>
<property name="tooltip-text" translatable="yes">Open the New Invoice dialog</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>
<child>
<object class="GtkToolButton" id="but5">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">New _Invoice</property>
<property name="action-name">GncPluginPageInvoiceActions.BusinessNewInvoiceAction</property>
<property name="tooltip-text" translatable="yes">Create a new invoice for the same owner as the current one</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="GtkToolButton" id="but6">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">_Edit Invoice</property>
<property name="action-name">GncPluginPageInvoiceActions.EditEditInvoiceAction</property>
<property name="tooltip-text" translatable="yes">Edit this invoice</property>
<property name="use-underline">True</property>
<property name="icon-name">gnc-invoice-edit</property>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
<object class="GtkToolButton" id="but7">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">_Duplicate Invoice</property>
<property name="action-name">GncPluginPageInvoiceActions.EditDuplicateInvoiceAction</property>
<property name="tooltip-text" translatable="yes">Create a new invoice as a duplicate of the current one</property>
<property name="use-underline">True</property>
<property name="icon-name">gnc-invoice-duplicate</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="but8">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">_Enter</property>
<property name="action-name">GncPluginPageInvoiceActions.RecordEntryAction</property>
<property name="tooltip-text" translatable="yes">Record the current entry</property>
<property name="use-underline">True</property>
<property name="icon-name">list-add</property>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
<object class="GtkToolButton" id="but9">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">_Cancel</property>
<property name="action-name">GncPluginPageInvoiceActions.CancelEntryAction</property>
<property name="tooltip-text" translatable="yes">Cancel the current entry</property>
<property name="use-underline">True</property>
<property name="icon-name">process-stop</property>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
<object class="GtkToolButton" id="but10">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">_Delete</property>
<property name="action-name">GncPluginPageInvoiceActions.DeleteEntryAction</property>
<property name="tooltip-text" translatable="yes">Delete the current entry</property>
<property name="use-underline">True</property>
<property name="icon-name">edit-delete</property>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
<object class="GtkToolButton" id="but11">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Dup_licate Entry</property>
<property name="action-name">GncPluginPageInvoiceActions.DuplicateEntryAction</property>
<property name="tooltip-text" translatable="yes">Make a copy of the current entry</property>
<property name="use-underline">True</property>
<property name="icon-name">edit-copy</property>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
<object class="GtkToolButton" id="but12">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Move Entry _Up</property>
<property name="action-name">GncPluginPageInvoiceActions.EntryUpAction</property>
<property name="tooltip-text" translatable="yes">Move the current entry one row upwards</property>
<property name="use-underline">True</property>
<property name="icon-name">pan-up-symbolic</property>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
<object class="GtkToolButton" id="but13">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Move Entry Do_wn</property>
<property name="action-name">GncPluginPageInvoiceActions.EntryDownAction</property>
<property name="tooltip-text" translatable="yes">Move the current entry one row downwards</property>
<property name="use-underline">True</property>
<property name="icon-name">pan-down-symbolic</property>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
<object class="GtkToolButton" id="but14">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">_Blank</property>
<property name="action-name">GncPluginPageInvoiceActions.BlankEntryAction</property>
<property name="tooltip-text" translatable="yes">Move to the blank entry at the bottom of the Invoice</property>
<property name="use-underline">True</property>
<property name="icon-name">go-bottom</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="but15">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">_Post Invoice</property>
<property name="action-name">GncPluginPageInvoiceActions.EditPostInvoiceAction</property>
<property name="tooltip-text" translatable="yes">Post this invoice to your Chart of Accounts</property>
<property name="use-underline">True</property>
<property name="icon-name">gnc-invoice-post</property>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
<object class="GtkToolButton" id="but16">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">_Unpost Invoice</property>
<property name="action-name">GncPluginPageInvoiceActions.EditUnpostInvoiceAction</property>
<property name="tooltip-text" translatable="yes">Unpost this invoice and make it editable</property>
<property name="use-underline">True</property>
<property name="icon-name">gnc-invoice-unpost</property>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
<object class="GtkToolButton" id="but17">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">_Pay Invoice</property>
<property name="action-name">GncPluginPageInvoiceActions.ToolsProcessPaymentAction</property>
<property name="tooltip-text" translatable="yes">Enter a payment for the owner of this invoice</property>
<property name="use-underline">True</property>
<property name="icon-name">gnc-invoice-pay</property>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
</object>
</interface>

View File

@ -1,61 +0,0 @@
<ui>
<menubar>
<menu name="Edit" action="EditAction">
<placeholder name="EditSelectedPlaceholder">
<menuitem name="EditEditVendor" action="OTEditVendorAction"/>
<menuitem name="EditEditCustomer" action="OTEditCustomerAction"/>
<menuitem name="EditEditEmployee" action="OTEditEmployeeAction"/>
<!-- <menuitem name="EditDeleteOwner" action="OTDeleteOwnerAction"/> -->
<menuitem name="EditNewVendor" action="OTNewVendorAction"/>
<menuitem name="EditNewCustomer" action="OTNewCustomerAction"/>
<menuitem name="EditNewEmployee" action="OTNewEmployeeAction"/>
</placeholder>
</menu>
<menu name="Reports" action="ReportsAction">
<placeholder name="OtherReports">
<menuitem name="ReportVendorListingReport" action="OTVendorListingReportAction"/>
<menuitem name="ReportCustomerListingReport" action="OTCustomerListingReportAction"/>
<menuitem name="ReportOTVendorReport" action="OTVendorReportAction"/>
<menuitem name="ReportOTCustomerReport" action="OTCustomerReportAction"/>
<menuitem name="ReportOTEmployeeReport" action="OTEmployeeReportAction"/>
</placeholder>
</menu>
</menubar>
<toolbar name="DefaultToolbar">
<placeholder name="DefaultToolbarPlaceholder">
<toolitem name="ToolbarNewVendor" action="OTNewVendorAction"/>
<toolitem name="ToolbarNewCustomer" action="OTNewCustomerAction"/>
<toolitem name="ToolbarNewEmployee" action="OTNewEmployeeAction"/>
<toolitem name="ToolbarEditVendor" action="OTEditVendorAction"/>
<toolitem name="ToolbarEditCustomer" action="OTEditCustomerAction"/>
<toolitem name="ToolbarEditEmployee" action="OTEditEmployeeAction"/>
<!-- <toolitem name="ToolbarDeleteOwner" action="OTDeleteOwnerAction"/> -->
<separator name="ToolbarSep168"/>
<toolitem name="ToolbarNewBill" action="OTNewBillAction"/>
<toolitem name="ToolbarNewInvoice" action="OTNewInvoiceAction"/>
<toolitem name="ToolbarNewVoucher" action="OTNewVoucherAction"/>
<toolitem name="ToolbarVendorListing" action="OTVendorListingReportAction"/>
<toolitem name="ToolbarCustomerListing" action="OTCustomerListingReportAction"/>
<toolitem name="ToolbarProcessPayment" action="OTProcessPaymentAction"/>
</placeholder>
</toolbar>
<popup name="MainPopup" action="FakeToplevel">
<placeholder name="PopupPlaceholder2">
<menuitem name="EditVendor" action="OTEditVendorAction"/>
<menuitem name="EditCustomer" action="OTEditCustomerAction"/>
<menuitem name="EditEmployee" action="OTEditEmployeeAction"/>
<!-- <menuitem name="DeleteOwner" action="OTDeleteOwnerAction"/> -->
<separator name="ToolbarSep169"/>
<menuitem name="NewBill" action="OTNewBillAction"/>
<menuitem name="NewInvoice" action="OTNewInvoiceAction"/>
<menuitem name="NewVoucher" action="OTNewVoucherAction"/>
<menuitem name="OTVendorReport" action="OTVendorReportAction"/>
<menuitem name="OTCustomerReport" action="OTCustomerReportAction"/>
<menuitem name="OTEmployeeReport" action="OTEmployeeReportAction"/>
<menuitem name="ProcessPayment" action="OTProcessPaymentAction"/>
</placeholder>
</popup>
</ui>

View File

@ -0,0 +1,695 @@
<?xml version="1.0"?>
<interface>
<menu id="FilePlaceholder3">
<item>
<attribute name="label" translatable="yes">_Print</attribute>
<attribute name="action">mainwin.FilePrintAction</attribute>
<attribute name="accel">&lt;Primary&gt;p</attribute>
<attribute name="tooltip" translatable="yes">Print the currently active page</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
</menu>
<menu id="EditPlaceholder2-c">
<item>
<attribute name="label" translatable="yes">E_dit Customer</attribute>
<attribute name="action">GncPluginPageOwnerTreeActions.OTEditCustomerAction</attribute>
<attribute name="accel">&lt;Primary&gt;e</attribute>
<attribute name="tooltip" translatable="yes">Edit the selected customer</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_New Customer...</attribute>
<attribute name="action">GncPluginPageOwnerTreeActions.OTNewCustomerAction</attribute>
<attribute name="tooltip" translatable="yes">Create a new customer</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
</menu>
<menu id="EditPlaceholder2-v">
<item>
<attribute name="label" translatable="yes">E_dit Vendor</attribute>
<attribute name="action">GncPluginPageOwnerTreeActions.OTEditVendorAction</attribute>
<attribute name="accel">&lt;Primary&gt;e</attribute>
<attribute name="tooltip" translatable="yes">Edit the selected vendor</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_New Vendor...</attribute>
<attribute name="action">GncPluginPageOwnerTreeActions.OTNewVendorAction</attribute>
<attribute name="tooltip" translatable="yes">Create a new vendor</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
</menu>
<menu id="EditPlaceholder2-e">
<item>
<attribute name="label" translatable="yes">E_dit Employee</attribute>
<attribute name="action">GncPluginPageOwnerTreeActions.OTEditEmployeeAction</attribute>
<attribute name="accel">&lt;Primary&gt;e</attribute>
<attribute name="tooltip" translatable="yes">Edit the selected employee</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_New Employee...</attribute>
<attribute name="action">GncPluginPageOwnerTreeActions.OTNewEmployeeAction</attribute>
<attribute name="tooltip" translatable="yes">Create a new employee</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
</menu>
<menu id="EditPlaceholder3">
<item>
<attribute name="label" translatable="yes">_Find...</attribute>
<attribute name="action">gnc-plugin-basic-commands-actions.EditFindTransactionsAction</attribute>
<attribute name="accel">&lt;Primary&gt;f</attribute>
<attribute name="tooltip" translatable="yes">Find transactions with a search</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
</menu>
<menu id="EditPlaceholder5">
<item>
<!-- Translators: remember to reuse this translation in dialog-account.glade -->
<attribute name="label" translatable="yes">Ta_x Report Options</attribute>
<attribute name="action">GncPluginPageOwnerTreeActions.EditTaxOptionsAction</attribute>
<!-- Translators: currently implemented are, US: income tax and DE: VAT, So adjust this string -->
<attribute name="tooltip" translatable="yes">Setup relevant accounts for tax reports, e.g. US income tax</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
</menu>
<menu id="ViewPlaceholder1">
<item>
<attribute name="label" translatable="yes">_Filter By...</attribute>
<attribute name="action">GncPluginPageOwnerTreeActions.ViewFilterByAction</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
</menu>
<menu id="ViewPlaceholder4">
<item>
<attribute name="label" translatable="yes">_Refresh</attribute>
<attribute name="action">GncPluginPageOwnerTreeActions.ViewRefreshAction</attribute>
<attribute name="accel">&lt;Primary&gt;r</attribute>
<attribute name="tooltip" translatable="yes">Refresh this window</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
</menu>
<menu id="ReportsPlaceholder1-c">
<item>
<attribute name="label" translatable="yes">Customer Report</attribute>
<attribute name="action">GncPluginPageOwnerTreeActions.OTCustomerReportAction</attribute>
<attribute name="tooltip" translatable="yes">Show customer report</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Customer Listing</attribute>
<attribute name="action">GncPluginPageOwnerTreeActions.OTCustomerListingReportAction</attribute>
<attribute name="tooltip" translatable="yes">Show customer aging overview for all customers</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
</menu>
<menu id="ReportsPlaceholder1-v">
<item>
<attribute name="label" translatable="yes">Vendor Report</attribute>
<attribute name="action">GncPluginPageOwnerTreeActions.OTVendorReportAction</attribute>
<attribute name="tooltip" translatable="yes">Show vendor report</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
<item>
<attribute name="label" translatable="no">Vendor Listing</attribute>
<attribute name="action">GncPluginPageOwnerTreeActions.OTVendorListingReportAction</attribute>
<attribute name="tooltip" translatable="yes">Show vendor aging overview for all vendors</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
</menu>
<menu id="ReportsPlaceholder1-e">
<item>
<attribute name="label" translatable="no">Employee Report</attribute>
<attribute name="action">GncPluginPageOwnerTreeActions.OTEmployeeReportAction</attribute>
<attribute name="tooltip" translatable="yes">Show employee report</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
</menu>
<menu id="mainwin-popup-c">
<section>
<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>
<section>
<item>
<attribute name="label" translatable="yes">E_dit Customer</attribute>
<attribute name="action">GncPluginPageOwnerTreeActions.OTEditCustomerAction</attribute>
<attribute name="tooltip" translatable="yes">Edit the selected customer</attribute>
</item>
</section>
<section>
<item>
<attribute name="label" translatable="yes">New _Invoice...</attribute>
<attribute name="action">GncPluginPageOwnerTreeActions.OTNewInvoiceAction</attribute>
<attribute name="tooltip" translatable="yes">Create a new invoice</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Customer Report</attribute>
<attribute name="action">GncPluginPageOwnerTreeActions.OTCustomerReportAction</attribute>
<attribute name="tooltip" translatable="yes">Show customer report</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Process Payment</attribute>
<attribute name="action">GncPluginPageOwnerTreeActions.OTProcessPaymentAction</attribute>
<attribute name="tooltip" translatable="yes">Process Payment</attribute>
</item>
</section>
</menu>
<menu id="mainwin-popup-v">
<section>
<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>
<section>
<item>
<attribute name="label" translatable="yes">E_dit Vendor</attribute>
<attribute name="action">GncPluginPageOwnerTreeActions.OTEditVendorAction</attribute>
<attribute name="tooltip" translatable="yes">Edit the selected vendor</attribute>
</item>
</section>
<section>
<item>
<attribute name="label" translatable="yes">New _Bill...</attribute>
<attribute name="action">GncPluginPageOwnerTreeActions.OTNewBillAction</attribute>
<attribute name="tooltip" translatable="yes">Create a new bill</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Vendor Report</attribute>
<attribute name="action">GncPluginPageOwnerTreeActions.OTVendorReportAction</attribute>
<attribute name="tooltip" translatable="yes">Show vendor report</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Process Payment</attribute>
<attribute name="action">GncPluginPageOwnerTreeActions.OTProcessPaymentAction</attribute>
<attribute name="tooltip" translatable="yes">Process Payment</attribute>
</item>
</section>
</menu>
<menu id="mainwin-popup-e">
<section>
<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>
<section>
<item>
<attribute name="label" translatable="yes">E_dit Employee</attribute>
<attribute name="action">GncPluginPageOwnerTreeActions.OTEditEmployeeAction</attribute>
<attribute name="tooltip" translatable="yes">Edit the selected customer</attribute>
</item>
</section>
<section>
<item>
<attribute name="label" translatable="yes">New _Voucher...</attribute>
<attribute name="action">GncPluginPageOwnerTreeActions.OTNewVoucherAction</attribute>
<attribute name="tooltip" translatable="yes">Create a new voucher</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Employee Report</attribute>
<attribute name="action">GncPluginPageOwnerTreeActions.OTEmployeeReportAction</attribute>
<attribute name="tooltip" translatable="yes">Show employee report</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Process Payment</attribute>
<attribute name="action">GncPluginPageOwnerTreeActions.OTProcessPaymentAction</attribute>
<attribute name="tooltip" translatable="yes">Process Payment</attribute>
</item>
</section>
</menu>
<object class="GtkToolbar" id="mainwin-toolbar-c">
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
<object class="GtkToolButton" id="but1c">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">_Save</property>
<property name="action-name">gnc-plugin-basic-commands-actions.FileSaveAction</property>
<property name="tooltip-text" translatable="yes">Save the current file</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="but2c">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">_Close</property>
<property name="action-name">mainwin.FileCloseAction</property>
<property name="tooltip-text" translatable="yes">Close the currently active page</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="but2ca">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">New _Invoice...</property>
<property name="action-name">gnc-plugin-business-actions.ToolbarNewInvoiceAction</property>
<property name="tooltip-text" translatable="yes">Open the New Invoice dialog</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_c">
<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="but3c">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">_New Customer...</property>
<property name="action-name">GncPluginPageOwnerTreeActions.OTNewCustomerAction</property>
<property name="tooltip-text" translatable="yes">Create a new customer</property>
<property name="use-underline">True</property>
<property name="icon-name">gnc-account-new</property>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
<object class="GtkToolButton" id="but4c">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">E_dit Customer</property>
<property name="action-name">GncPluginPageOwnerTreeActions.OTEditCustomerAction</property>
<property name="tooltip-text" translatable="yes">Edit the selected customer</property>
<property name="use-underline">True</property>
<property name="icon-name">gnc-account-edit</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="but5c">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">New _Invoice...</property>
<property name="action-name">GncPluginPageOwnerTreeActions.OTNewInvoiceAction</property>
<property name="tooltip-text" translatable="yes">Create a new invoice</property>
<property name="use-underline">True</property>
<property name="icon-name">gnc-invoice-pay</property>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
<object class="GtkToolButton" id="but6c">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Customer Listing</property>
<property name="action-name">GncPluginPageOwnerTreeActions.OTCustomerListingReportAction</property>
<property name="tooltip-text" translatable="yes">Show customer aging overview for all customers</property>
<property name="use-underline">True</property>
<property name="icon-name">document-print-preview</property>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
<object class="GtkToolButton" id="but7c">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Process Payment</property>
<property name="action-name">GncPluginPageOwnerTreeActions.OTProcessPaymentAction</property>
<property name="tooltip-text" translatable="yes">Process Payment</property>
<property name="use-underline">True</property>
<property name="icon-name">gnc-invoice-pay</property>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
</object>
<object class="GtkToolbar" id="mainwin-toolbar-v">
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
<object class="GtkToolButton" id="but1v">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">_Save</property>
<property name="action-name">gnc-plugin-basic-commands-actions.FileSaveAction</property>
<property name="tooltip-text" translatable="yes">Save the current file</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="but2v">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">_Close</property>
<property name="action-name">mainwin.FileCloseAction</property>
<property name="tooltip-text" translatable="yes">Close the currently active page</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="but2va">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">New _Invoice...</property>
<property name="action-name">gnc-plugin-business-actions.ToolbarNewInvoiceAction</property>
<property name="tooltip-text" translatable="yes">Open the New Invoice dialog</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_v">
<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="but3v">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">_New Vendor...</property>
<property name="action-name">GncPluginPageOwnerTreeActions.OTNewVendorAction</property>
<property name="tooltip-text" translatable="yes">Create a new vendor</property>
<property name="use-underline">True</property>
<property name="icon-name">gnc-account-new</property>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
<object class="GtkToolButton" id="but4v">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">E_dit Vendor</property>
<property name="action-name">GncPluginPageOwnerTreeActions.OTEditVendorAction</property>
<property name="tooltip-text" translatable="yes">Edit the selected vendor</property>
<property name="use-underline">True</property>
<property name="icon-name">gnc-account-edit</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="but5v">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">New _Bill...</property>
<property name="action-name">GncPluginPageOwnerTreeActions.OTNewBillAction</property>
<property name="tooltip-text" translatable="yes">Create a new bill</property>
<property name="use-underline">True</property>
<property name="icon-name">gnc-invoice-pay</property>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
<object class="GtkToolButton" id="but6v">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Vendor Listing</property>
<property name="action-name">GncPluginPageOwnerTreeActions.OTVendorListingReportAction</property>
<property name="tooltip-text" translatable="yes">Show vendor aging overview for all vendors</property>
<property name="use-underline">True</property>
<property name="icon-name">document-print-preview</property>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
<object class="GtkToolButton" id="but7v">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Process Payment</property>
<property name="action-name">GncPluginPageOwnerTreeActions.OTProcessPaymentAction</property>
<property name="tooltip-text" translatable="yes">Process Payment</property>
<property name="use-underline">True</property>
<property name="icon-name">gnc-invoice-pay</property>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
</object>
<object class="GtkToolbar" id="mainwin-toolbar-e">
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
<object class="GtkToolButton" id="but1e">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">_Save</property>
<property name="action-name">gnc-plugin-basic-commands-actions.FileSaveAction</property>
<property name="tooltip-text" translatable="yes">Save the current file</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="but2e">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">_Close</property>
<property name="action-name">mainwin.FileCloseAction</property>
<property name="tooltip-text" translatable="yes">Close the currently active page</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="but2ea">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">New _Invoice...</property>
<property name="action-name">gnc-plugin-business-actions.ToolbarNewInvoiceAction</property>
<property name="tooltip-text" translatable="yes">Open the New Invoice dialog</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_e">
<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="but3e">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">_New Employee...</property>
<property name="action-name">GncPluginPageOwnerTreeActions.OTNewEmployeeAction</property>
<property name="tooltip-text" translatable="yes">Create a new employee</property>
<property name="use-underline">True</property>
<property name="icon-name">gnc-account-new</property>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
<object class="GtkToolButton" id="but4e">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">E_dit Employee</property>
<property name="action-name">GncPluginPageOwnerTreeActions.OTEditEmployeeAction</property>
<property name="tooltip-text" translatable="yes">Edit the selected employee</property>
<property name="use-underline">True</property>
<property name="icon-name">gnc-account-edit</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="but5e">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">New _Voucher...</property>
<property name="action-name">GncPluginPageOwnerTreeActions.OTNewVoucherAction</property>
<property name="tooltip-text" translatable="yes">Create a new voucher</property>
<property name="use-underline">True</property>
<property name="icon-name">gnc-invoice-pay</property>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
<object class="GtkToolButton" id="but6e">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Process Payment</property>
<property name="action-name">GncPluginPageOwnerTreeActions.OTProcessPaymentAction</property>
<property name="tooltip-text" translatable="yes">Process Payment</property>
<property name="use-underline">True</property>
<property name="icon-name">gnc-invoice-pay</property>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
</object>
</interface>

View File

@ -1,119 +0,0 @@
<ui>
<menubar>
<menu name="Edit" action="EditAction">
<placeholder name="EditAllSelectedPlaceholder">
<menuitem name="EditEditAccount" action="EditEditAccountAction"/>
<menuitem name="EditFindAccount" action="EditFindAccountAction"/>
</placeholder>
<menuitem name="EditTaxOptions" action="EditTaxOptionsAction"/>
</menu>
<menu name="Transaction" action="TransactionAction">
<menuitem name="CutTransaction" action="CutTransactionAction"/>
<menuitem name="CopyTransaction" action="CopyTransactionAction"/>
<menuitem name="PasteTransaction" action="PasteTransactionAction"/>
<menuitem name="DuplicateTransaction" action="DuplicateTransactionAction"/>
<menuitem name="DeleteTransaction" action="DeleteTransactionAction"/>
<menuitem name="RemoveTransactionSplits" action="RemoveTransactionSplitsAction"/>
<separator name="TransactionSep1"/>
<menuitem name="RecordTransaction" action="RecordTransactionAction"/>
<menuitem name="CancelTransaction" action="CancelTransactionAction"/>
<separator name="TransactionSep2"/>
<menuitem name="VoidTransaction" action="VoidTransactionAction"/>
<menuitem name="UnvoidTransaction" action="UnvoidTransactionAction"/>
<menuitem name="ReverseTransaction" action="ReverseTransactionAction"/>
<separator name="TransactionSep3"/>
<menuitem name="LinkTransaction" action="LinkTransactionAction"/>
<menuitem name="LinkedTransactionOpen" action="LinkedTransactionOpenAction"/>
<separator name="TransactionSep4"/>
<menuitem name="JumpLinkInvoice" action="JumpLinkedInvoiceAction"/>
</menu>
<menu name="View" action="ViewAction">
<placeholder name="ViewContentPlaceholder">
<menuitem name="ViewStyleBasic" action="ViewStyleBasicAction"/>
<menuitem name="ViewStyleAutoSplit" action="ViewStyleAutoSplitAction"/>
<menuitem name="ViewStyleJournal" action="ViewStyleJournalAction"/>
<separator name="ViewSep44"/>
<menuitem name="ViewStyleDoubleLine" action="ViewStyleDoubleLineAction"/>
</placeholder>
</menu>
<menu name="Actions" action="ActionsAction">
<placeholder name="ActionsPlaceholder">
<separator name="ActionsSep1"/>
<menuitem name="ActionsTransfer" action="ActionsTransferAction"/>
<menuitem name="ActionsReconcile" action="ActionsReconcileAction"/>
<menuitem name="ActionsAutoClear" action="ActionsAutoClearAction"/>
<menuitem name="ActionsStockSplit" action="ActionsStockSplitAction"/>
<menuitem name="ActionsStockAssistant" action="ActionsStockAssistantAction"/>
<menuitem name="ActionLots" action="ActionsLotsAction"/>
<separator name="ActionsSep4"/>
<menuitem name="BlankTransaction" action="BlankTransactionAction"/>
<menuitem name="GotoDate" action="GotoDateAction"/>
<menuitem name="SplitTransaction" action="SplitTransactionAction"/>
<menuitem name="EditExchangeRate" action="EditExchangeRateAction"/>
<menuitem name="ScheduleTransaction" action="ScheduleTransactionAction"/>
<menuitem name="JumpTransaction" action="JumpTransactionAction"/>
<separator name="ActionsSep5"/>
</placeholder>
<menu name="ScrubMenu" action="ScrubMenuAction">
<menuitem name="ScrubAll" action="ScrubAllAction"/>
<menuitem name="ScrubCurrent" action="ScrubCurrentAction"/>
</menu>
</menu>
<menu name="Reports" action="ReportsAction">
<placeholder name="AccountReports">
<menuitem name="ReportsAccountReport" action="ReportsAccountReportAction"/>
<menuitem name="ReportsAcctTransReport" action="ReportsAcctTransReportAction"/>
</placeholder>
</menu>
</menubar>
<toolbar name="DefaultToolbar">
<placeholder name="DefaultToolbarPlaceholder">
<toolitem name="ToolbarDuplicateTransaction" action="DuplicateTransactionAction"/>
<toolitem name="ToolbarDeleteTransaction" action="DeleteTransactionAction"/>
<separator name="ToolbarSep66"/>
<toolitem name="ToolbarRecordTransaction" action="RecordTransactionAction"/>
<toolitem name="ToolbarCancelTransaction" action="CancelTransactionAction"/>
<separator name="ToolbarSep67"/>
<toolitem name="ToolbarBlankTransaction" action="BlankTransactionAction"/>
<toolitem name="ToolbarSplitTransaction" action="SplitTransactionAction"/>
<toolitem name="ToolbarJumpTransaction" action="JumpTransactionAction"/>
<toolitem name="ToolbarScheduleTransaction" action="ScheduleTransactionAction"/>
<separator name="ToolbarSep68"/>
<toolitem name="ToolbarTransfer" action="ActionsTransferAction"/>
<toolitem name="ActionsReconcile" action="ActionsReconcileAction"/>
<toolitem name="ActionsAssistant" action="ActionsStockAssistantAction"/>
</placeholder>
</toolbar>
<popup name="MainPopup" action="FakeToplevel">
<placeholder name="PopupPlaceholder1">
<menuitem name="ViewSortBy" action="ViewSortByAction"/>
<menuitem name="ViewFilterBy" action="ViewFilterByAction"/>
</placeholder>
<placeholder name="PopupPlaceholder2">
<menuitem name="DuplicateTransaction" action="DuplicateTransactionAction"/>
<menuitem name="DeleteTransaction" action="DeleteTransactionAction"/>
<menuitem name="RemoveTransactionSplits" action="RemoveTransactionSplitsAction"/>
<separator name="PopupSep2"/>
<menuitem name="RecordTransaction" action="RecordTransactionAction"/>
<menuitem name="CancelTransaction" action="CancelTransactionAction"/>
<separator name="PopupSep3"/>
<menuitem name="LinkTransaction" action="LinkTransactionAction"/>
<menuitem name="LinkedTransactionOpen" action="LinkedTransactionOpenAction"/>
<separator name="PopupSep4"/>
<menuitem name="JumpLinkedInvoice" action="JumpLinkedInvoiceAction"/>
<separator name="PopupSep5"/>
<menuitem name="BlankTransaction" action="BlankTransactionAction"/>
<menuitem name="GotoDate" action="GotoDateAction"/>
<menuitem name="SplitTransaction" action="SplitTransactionAction"/>
<menuitem name="EditExchangeRate" action="EditExchangeRateAction"/>
<menuitem name="ScheduleTransaction" action="ScheduleTransactionAction"/>
<menuitem name="JumpTransaction" action="JumpTransactionAction"/>
</placeholder>
</popup>
</ui>

View File

@ -0,0 +1,725 @@
<?xml version="1.0"?>
<interface>
<menu id="FilePlaceholder3">
<item>
<attribute name="label" translatable="yes">_Print Cheques</attribute>
<attribute name="action">GncPluginPageRegisterActions.FilePrintAction</attribute>
<attribute name="accel">&lt;Primary&gt;p</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
</menu>
<menu id="EditPlaceholder1">
<item>
<attribute name="label" translatable="yes">Assign as payment...</attribute>
<attribute name="action">gnc-plugin-business-actions.RegisterAssignPayment</attribute>
<attribute name="tooltip" translatable="yes">Assign the selected transaction as payment</attribute>
<attribute name="temp" translatable="no">yes</attribute>
<attribute name="hidden-when">action-disabled</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Edit payment...</attribute>
<attribute name="action">gnc-plugin-business-actions.RegisterEditPayment</attribute>
<attribute name="tooltip" translatable="yes">Edit the payment this transaction is a part of</attribute>
<attribute name="temp" translatable="no">yes</attribute>
<attribute name="hidden-when">action-disabled</attribute>
</item>
</menu>
<menu id="EditPlaceholder2">
<item>
<attribute name="label" translatable="yes">_Edit Account</attribute>
<attribute name="action">GncPluginPageRegisterActions.EditEditAccountAction</attribute>
<attribute name="accel">&lt;Primary&gt;e</attribute>
<attribute name="tooltip" translatable="yes">Edit the selected account</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
<item>
<attribute name="label" translatable="yes">F_ind Account</attribute>
<attribute name="action">GncPluginPageRegisterActions.EditFindAccountAction</attribute>
<attribute name="accel">&lt;Primary&gt;i</attribute>
<attribute name="tooltip" translatable="yes">Find an account</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
</menu>
<menu id="EditPlaceholder3">
<item>
<attribute name="label" translatable="yes">_Find...</attribute>
<attribute name="action">gnc-plugin-basic-commands-actions.EditFindTransactionsAction</attribute>
<attribute name="accel">&lt;Primary&gt;f</attribute>
<attribute name="tooltip" translatable="yes">Find transactions with a search</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
</menu>
<menu id="EditPlaceholder5">
<item>
<!-- Translators: remember to reuse this translation in dialog-account.glade -->
<attribute name="label" translatable="yes">Ta_x Report Options</attribute>
<attribute name="action">GncPluginPageRegisterActions.EditTaxOptionsAction</attribute>
<!-- Translators: currently implemented are, US: income tax and DE: VAT, So adjust this string -->
<attribute name="tooltip" translatable="yes">Setup relevant accounts for tax reports, e.g. US income tax</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
</menu>
<menu id="ViewPlaceholder1">
<item>
<!-- Translators: This is a menu item in the View menu -->
<attribute name="label" translatable="yes">_Basic Ledger</attribute>
<attribute name="action">GncPluginPageRegisterActions.ViewStyleRadioAction</attribute>
<attribute name="target" type="i">0</attribute>
<attribute name="tooltip" translatable="yes">Show transactions on one or two lines</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
<item>
<!-- Translators: This is a menu item in the View menu -->
<attribute name="label" translatable="yes">_Auto-Split Ledger</attribute>
<attribute name="action">GncPluginPageRegisterActions.ViewStyleRadioAction</attribute>
<attribute name="target" type="i">1</attribute>
<attribute name="tooltip" translatable="yes">Show transactions on one or two lines and expand the current transaction</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
<item>
<!-- Translators: This is a menu item in the View menu -->
<attribute name="label" translatable="yes">Transaction _Journal</attribute>
<attribute name="action">GncPluginPageRegisterActions.ViewStyleRadioAction</attribute>
<attribute name="target" type="i">2</attribute>
<attribute name="tooltip" translatable="yes">Show expanded transactions with all splits</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
</menu>
<menu id="ViewPlaceholder2">
<item>
<attribute name="label" translatable="yes">_Double Line</attribute>
<attribute name="action">GncPluginPageRegisterActions.ViewStyleDoubleLineAction</attribute>
<attribute name="tooltip" translatable="yes">Show a second line with \"Action\", \"Notes\", and \"Linked Document\" for each transaction</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
</menu>
<menu id="ViewPlaceholder3">
<item>
<attribute name="label" translatable="no">_Sort By...</attribute>
<attribute name="action">GncPluginPageRegisterActions.ViewSortByAction</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
<item>
<attribute name="label" translatable="no">_Filter By...</attribute>
<attribute name="action">GncPluginPageRegisterActions.ViewFilterByAction</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
</menu>
<menu id="ViewPlaceholder4">
<item>
<attribute name="label" translatable="yes">_Refresh</attribute>
<attribute name="action">GncPluginPageRegisterActions.ViewRefreshAction</attribute>
<attribute name="accel">&lt;Primary&gt;r</attribute>
<attribute name="tooltip" translatable="yes">Refresh this window</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
</menu>
<menu id="TransPlaceholder0">
<item>
<attribute name="label" translatable="yes">Cu_t Transaction</attribute>
<attribute name="action">GncPluginPageRegisterActions.CutTransactionAction</attribute>
<attribute name="tooltip" translatable="yes">Cut the selected transaction into clipboard</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Copy Transaction</attribute>
<attribute name="action">GncPluginPageRegisterActions.CopyTransactionAction</attribute>
<attribute name="tooltip" translatable="yes">Copy the selected transaction into clipboard</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Paste Transaction</attribute>
<attribute name="action">GncPluginPageRegisterActions.PasteTransactionAction</attribute>
<attribute name="tooltip" translatable="yes">Paste the transaction from the clipboard</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Dup_licate Transaction</attribute>
<attribute name="action">GncPluginPageRegisterActions.DuplicateTransactionAction</attribute>
<attribute name="tooltip" translatable="yes">Make a copy of the current transaction</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Delete Transaction</attribute>
<attribute name="action">GncPluginPageRegisterActions.DeleteTransactionAction</attribute>
<attribute name="tooltip" translatable="yes">Delete the current transaction</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Remo_ve Other Splits</attribute>
<attribute name="action">GncPluginPageRegisterActions.RemoveTransactionSplitsAction</attribute>
<attribute name="tooltip" translatable="yes">Remove all splits in the current transaction</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
</menu>
<menu id="TransPlaceholder1">
<item>
<attribute name="label" translatable="yes">_Enter Transaction</attribute>
<attribute name="action">GncPluginPageRegisterActions.RecordTransactionAction</attribute>
<attribute name="tooltip" translatable="yes">Record the current transaction</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Ca_ncel Transaction</attribute>
<attribute name="action">GncPluginPageRegisterActions.CancelTransactionAction</attribute>
<attribute name="tooltip" translatable="yes">Cancel the current transaction</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
</menu>
<menu id="TransPlaceholder2">
<item>
<attribute name="label" translatable="yes">_Void Transaction</attribute>
<attribute name="action">GncPluginPageRegisterActions.VoidTransactionAction</attribute>
<attribute name="tooltip" translatable="yes">Void the current transaction</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Unvoid Transaction</attribute>
<attribute name="action">GncPluginPageRegisterActions.UnvoidTransactionAction</attribute>
<attribute name="tooltip" translatable="yes">Unvoid the current transaction</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Add _Reversing Transaction</attribute>
<attribute name="action">GncPluginPageRegisterActions.ReverseTransactionAction</attribute>
<attribute name="tooltip" translatable="yes">Add a reversing transaction</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
</menu>
<menu id="TransPlaceholder3">
<item>
<attribute name="label" translatable="yes">Manage Document Link...</attribute>
<attribute name="action">GncPluginPageRegisterActions.LinkTransactionAction</attribute>
<attribute name="tooltip" translatable="yes">Add, change, or unlink the document linked with the current transaction</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Open Linked Document</attribute>
<attribute name="action">GncPluginPageRegisterActions.LinkedTransactionOpenAction</attribute>
<attribute name="tooltip" translatable="yes">Open the linked document for the current transaction</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
</menu>
<menu id="TransPlaceholder4">
<item>
<attribute name="label" translatable="yes">Jump to Invoice</attribute>
<attribute name="action">GncPluginPageRegisterActions.JumpLinkedInvoiceAction</attribute>
<attribute name="tooltip" translatable="yes">Jump to the linked bill, invoice, or voucher</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
</menu>
<menu id="ActionsPlaceholder4">
<item>
<attribute name="label" translatable="yes">_Transfer...</attribute>
<attribute name="action">GncPluginPageRegisterActions.ActionsTransferAction</attribute>
<attribute name="accel">&lt;Primary&gt;t</attribute>
<attribute name="tooltip" translatable="yes">Transfer funds from one account to another</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Reconcile...</attribute>
<attribute name="action">GncPluginPageRegisterActions.ActionsReconcileAction</attribute>
<attribute name="tooltip" translatable="yes">Reconcile the selected account</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Auto-clear...</attribute>
<attribute name="action">GncPluginPageRegisterActions.ActionsAutoClearAction</attribute>
<attribute name="tooltip" translatable="yes">Automatically clear individual transactions, so as to reach a certain cleared amount</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Stock Ass_istant</attribute>
<attribute name="action">GncPluginPageRegisterActions.ActionsStockAssistantAction</attribute>
<attribute name="tooltip" translatable="yes">Stock Assistant</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Stoc_k Split...</attribute>
<attribute name="action">GncPluginPageRegisterActions.ActionsStockSplitAction</attribute>
<attribute name="tooltip" translatable="yes">Record a stock split or a stock merger</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
<item>
<attribute name="label" translatable="yes">View _Lots...</attribute>
<attribute name="action">GncPluginPageRegisterActions.ActionsLotsAction</attribute>
<attribute name="tooltip" translatable="yes">Bring up the lot viewer/editor window</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
</menu>
<menu id="ActionsPlaceholder5">
<item>
<attribute name="label" translatable="yes">_Blank Transaction</attribute>
<attribute name="action">GncPluginPageRegisterActions.BlankTransactionAction</attribute>
<attribute name="accel">&lt;Primary&gt;Page_Down</attribute>
<attribute name="tooltip" translatable="yes">Move to the blank transaction at the bottom of the register</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Got to Date</attribute>
<attribute name="action">GncPluginPageRegisterActions.GotoDateAction</attribute>
<attribute name="accel">&lt;Primary&gt;g</attribute>
<attribute name="tooltip" translatable="yes">Move to the split at the specified date</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
<item>
<attribute name="label" translatable="yes">S_plit Transaction</attribute>
<attribute name="action">GncPluginPageRegisterActions.SplitTransactionAction</attribute>
<attribute name="tooltip" translatable="yes">Show all splits in the current transaction</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Edit E_xchange Rate</attribute>
<attribute name="action">GncPluginPageRegisterActions.EditExchangeRateAction</attribute>
<attribute name="tooltip" translatable="yes">Edit the exchange rate for the current transaction</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Sche_dule...</attribute>
<attribute name="action">GncPluginPageRegisterActions.ScheduleTransactionAction</attribute>
<attribute name="tooltip" translatable="yes">Create a Scheduled Transaction with the current transaction as a template</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
<item>
<!-- Translators: This is a menu item that will open a register tab for the
account of the first other account in the current transaction's split list
with focus on the current transaction's entry in that register. -->
<attribute name="label" translatable="yes">_Jump to the other account</attribute>
<attribute name="action">GncPluginPageRegisterActions.JumpTransactionAction</attribute>
<attribute name="tooltip" translatable="yes">Open a new register tab for the other account with focus on this transaction</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
</menu>
<menu id="ActionsPlaceholder6">
<submenu>
<!-- Translators: The following 2 are Scrub actions in register view -->
<attribute name="label" translatable="yes">_Check &amp; Repair</attribute>
<attribute name="action">mainwin.ScrubMenuAction</attribute>
<attribute name="temp" translatable="no">yes</attribute>
<item>
<attribute name="label" translatable="yes">All Transactions</attribute>
<attribute name="action">GncPluginPageRegisterActions.ScrubAllAction</attribute>
<attribute name="tempx" translatable="no">yes</attribute>
</item>
<item>
<attribute name="label" translatable="yes">This transaction</attribute>
<attribute name="action">GncPluginPageRegisterActions.ScrubCurrentAction</attribute>
<attribute name="tempx" translatable="no">yes</attribute>
</item>
</submenu>
</menu>
<menu id="ReportsPlaceholder1">
<item>
<attribute name="label" translatable="yes">Account Report</attribute>
<attribute name="action">GncPluginPageRegisterActions.ReportsAccountReportAction</attribute>
<attribute name="tooltip" translatable="yes">Open a register report for this Account</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Account Report - Single Transaction</attribute>
<attribute name="action">GncPluginPageRegisterActions.ReportsAcctTransReportAction</attribute>
<attribute name="tooltip" translatable="yes">Open a register report for the selected Transaction</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
</menu>
<menu id="mainwin-popup">
<section>
<item>
<attribute name="label" translatable="yes">_Sort By...</attribute>
<attribute name="action">GncPluginPageRegisterActions.ViewSortByAction</attribute>
<attribute name="tooltip" translatable="yes">Filter accounts</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Filter By...</attribute>
<attribute name="action">GncPluginPageRegisterActions.ViewFilterByAction</attribute>
<attribute name="tooltip" translatable="yes">Filter accounts</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>
<section>
<item>
<attribute name="label" translatable="yes">Dup_licate Transaction</attribute>
<attribute name="action">GncPluginPageRegisterActions.DuplicateTransactionAction</attribute>
<attribute name="tooltip" translatable="yes">Make a copy of the current transaction</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Delete Transaction</attribute>
<attribute name="action">GncPluginPageRegisterActions.DeleteTransactionAction</attribute>
<attribute name="tooltip" translatable="yes">Delete the current transaction</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Remo_ve Other Splits</attribute>
<attribute name="action">GncPluginPageRegisterActions.RemoveTransactionSplitsAction</attribute>
<attribute name="tooltip" translatable="yes">Remove all splits in the current transaction</attribute>
</item>
</section>
<section>
<item>
<attribute name="label" translatable="yes">_Enter Transaction</attribute>
<attribute name="action">GncPluginPageRegisterActions.RecordTransactionAction</attribute>
<attribute name="tooltip" translatable="yes">Record the current transaction</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Ca_ncel Transaction</attribute>
<attribute name="action">GncPluginPageRegisterActions.CancelTransactionAction</attribute>
<attribute name="tooltip" translatable="yes">Cancel the current transaction</attribute>
</item>
</section>
<section>
<item>
<attribute name="label" translatable="yes">_Manage Document Link...</attribute>
<attribute name="action">GncPluginPageRegisterActions.LinkTransactionAction</attribute>
<attribute name="tooltip" translatable="yes">Add, change, or unlink the document linked with the current transaction</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Open Linked Document</attribute>
<attribute name="action">GncPluginPageRegisterActions.LinkedTransactionOpenAction</attribute>
<attribute name="tooltip" translatable="yes">Open the linked document for the current transaction</attribute>
</item>
</section>
<section>
<item>
<attribute name="label" translatable="yes">Jump to Invoice</attribute>
<attribute name="action">GncPluginPageRegisterActions.JumpLinkedInvoiceAction</attribute>
<attribute name="tooltip" translatable="yes">Jump to the linked bill, invoice, or voucher</attribute>
</item>
</section>
<section>
<item>
<attribute name="label" translatable="yes">_Blank Transaction</attribute>
<attribute name="action">GncPluginPageRegisterActions.BlankTransactionAction</attribute>
<attribute name="tooltip" translatable="yes">Move to the blank transaction at the bottom of the register</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Go to Date</attribute>
<attribute name="action">GncPluginPageRegisterActions.GotoDateAction</attribute>
<attribute name="tooltip" translatable="yes">Move to the split at the specified date</attribute>
</item>
<item>
<attribute name="label" translatable="yes">S_plit Transaction</attribute>
<attribute name="action">GncPluginPageRegisterActions.SplitTransactionAction</attribute>
<attribute name="tooltip" translatable="yes">Show all splits in the current transaction</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Edit E_xchange Rate</attribute>
<attribute name="action">GncPluginPageRegisterActions.EditExchangeRateAction</attribute>
<attribute name="tooltip" translatable="yes">Edit the exchange rate for the current transaction</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Sche_dule...</attribute>
<attribute name="action">GncPluginPageRegisterActions.ScheduleTransactionAction</attribute>
<attribute name="tooltip" translatable="yes">Create a Scheduled Transaction with the current transaction as a template</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Jump to the other account</attribute>
<attribute name="action">GncPluginPageRegisterActions.JumpTransactionAction</attribute>
<attribute name="tooltip" translatable="yes">Open a new register tab for the other account with focus on this transaction</attribute>
</item>
</section>
<section>
<item>
<attribute name="label" translatable="yes">Assign as payment...</attribute>
<attribute name="action">gnc-plugin-business-actions.RegisterAssignPayment</attribute>
<attribute name="tooltip" translatable="yes">Assign the selected transaction as payment</attribute>
<attribute name="hidden-when">action-disabled</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Edit payment...</attribute>
<attribute name="action">gnc-plugin-business-actions.RegisterEditPayment</attribute>
<attribute name="tooltip" translatable="yes">Edit the payment this transaction is a part of</attribute>
<attribute name="hidden-when">action-disabled</attribute>
</item>
</section>
</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="label" translatable="yes">_Save</property>
<property name="action-name">gnc-plugin-basic-commands-actions.FileSaveAction</property>
<property name="tooltip-text" translatable="yes">Save the current file</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="label" translatable="yes">_Close</property>
<property name="action-name">mainwin.FileCloseAction</property>
<property name="tooltip-text" translatable="yes">Close the currently active page</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="label" translatable="yes">New _Invoice...</property>
<property name="action-name">gnc-plugin-business-actions.ToolbarNewInvoiceAction</property>
<property name="tooltip-text" translatable="yes">Open the New Invoice dialog</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>
<child>
<object class="GtkToolButton" id="but3">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Dup_licate Transaction</property>
<property name="action-name">GncPluginPageRegisterActions.DuplicateTransactionAction</property>
<property name="tooltip-text" translatable="yes">Make a copy of the current transaction</property>
<property name="use-underline">True</property>
<property name="icon-name">edit-copy</property>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
<object class="GtkToolButton" id="but4">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">_Delete Transaction</property>
<property name="action-name">GncPluginPageRegisterActions.DeleteTransactionAction</property>
<property name="tooltip-text" translatable="yes">Delete the current transaction</property>
<property name="use-underline">True</property>
<property name="icon-name">edit-delete</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="but5">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">_Enter Transaction</property>
<property name="action-name">GncPluginPageRegisterActions.RecordTransactionAction</property>
<property name="tooltip-text" translatable="yes">Record the current transaction</property>
<property name="use-underline">True</property>
<property name="icon-name">list-add</property>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
<object class="GtkToolButton" id="but6">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Ca_ncel Transaction</property>
<property name="action-name">GncPluginPageRegisterActions.CancelTransactionAction</property>
<property name="tooltip-text" translatable="yes">Cancel the current transaction</property>
<property name="use-underline">True</property>
<property name="icon-name">process-stop</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="but7">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">_Blank Transaction</property>
<property name="action-name">GncPluginPageRegisterActions.BlankTransactionAction</property>
<property name="tooltip-text" translatable="yes">Move to the blank transaction at the bottom of the register</property>
<property name="use-underline">True</property>
<property name="icon-name">go-bottom</property>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
<object class="GtkToggleToolButton" id="but8">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">S_plit Transaction</property>
<property name="action-name">GncPluginPageRegisterActions.SplitTransactionAction</property>
<property name="tooltip-text" translatable="yes">Show all splits in the current transaction</property>
<property name="use-underline">True</property>
<property name="icon-name">gnc-split-trans</property>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
<object class="GtkToolButton" id="but9">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">_Jump to the other account</property>
<property name="action-name">GncPluginPageRegisterActions.JumpTransactionAction</property>
<property name="tooltip-text" translatable="yes">Open a new register tab for the other account with focus on this transaction</property>
<property name="use-underline">True</property>
<property name="icon-name">gnc-jumpto</property>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
<object class="GtkToolButton" id="but10">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Sche_dule...</property>
<property name="action-name">GncPluginPageRegisterActions.ScheduleTransactionAction</property>
<property name="tooltip-text" translatable="yes">Create a Scheduled Transaction with the current transaction as a template</property>
<property name="use-underline">True</property>
<property name="icon-name">gnc-sx-new</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="but11">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">_Transfer...</property>
<property name="action-name">GncPluginPageRegisterActions.ActionsTransferAction</property>
<property name="tooltip-text" translatable="yes">Transfer funds from one account to another</property>
<property name="use-underline">True</property>
<property name="icon-name">gnc-transfer</property>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
<object class="GtkToolButton" id="but12">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">_Reconcile...</property>
<property name="action-name">GncPluginPageRegisterActions.ActionsReconcileAction</property>
<property name="tooltip-text" translatable="yes">Reconcile the selected account</property>
<property name="use-underline">True</property>
<property name="icon-name">edit-select-all</property>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
<object class="GtkToolButton" id="but13">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Stoc_k Split...</property>
<property name="action-name">GncPluginPageRegisterActions.ActionsStockAssistantAction</property>
<property name="tooltip-text" translatable="yes">Stock Assistant</property>
<property name="use-underline">True</property>
<property name="icon-name">applications-utilities</property>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
</object>
</interface>

View File

@ -1,50 +0,0 @@
<ui>
<menubar>
<menu name="File" action="FileAction">
<placeholder name="FilePrintPlaceholder">
<menuitem name="FileExportPDF" action="FilePrintPDFAction"/>
</placeholder>
<menu name="FileExport" action="FileExportAction">
<placeholder name="FileExportPlaceholder">
<menuitem name="FileReportExport" action="ReportExportAction"/>
</placeholder>
</menu>
</menu>
<menu name="Edit" action="EditAction">
<placeholder name="EditStyleSheetsPlaceholder">
<menuitem name="EditReportOptions" action="ReportOptionsAction"/>
</placeholder>
</menu>
<menu name="Reports" action="ReportsAction">
<placeholder name="SavedReportConfigs">
<menuitem name="ReportSaveConfig" action="ReportSaveAction"/>
<menuitem name="ReportSaveConfigAs" action="ReportSaveAsAction"/>
</placeholder>
</menu>
</menubar>
<popup name="MainPopup" action="FakeToplevel">
<placeholder name="PopupPlaceholder1">
<menuitem name="PopupOptions" action="ReportOptionsAction"/>
</placeholder>
</popup>
<toolbar name="DefaultToolbar">
<placeholder name="DefaultToolbarPlaceholder">
<separator name="ReportToolbarSep0"/>
<toolitem name="ReportToolbarBack" action="ReportBackAction"/>
<toolitem name="ReportToolbarForw" action="ReportForwAction"/>
<toolitem name="ReportToolbarReload" action="ReportReloadAction"/>
<toolitem name="ReportToolbarStop" action="ReportStopAction"/>
<separator name="ReportToolbarSep1"/>
<toolitem name="ReportToolbarOptions" action="ReportOptionsAction"/>
<toolitem name="ReportToolbarSave" action="ReportSaveAction"/>
<toolitem name="ReportToolbarSaveAs" action="ReportSaveAsAction"/>
<toolitem name="ReportToolbarExport" action="ReportExportAction"/>
<toolitem name="ReportToolbarPrint" action="FilePrintAction" />
<toolitem name="ReportToolbarExportPDF" action="FilePrintPDFAction"/>
</placeholder>
</toolbar>
</ui>

View File

@ -0,0 +1,297 @@
<?xml version="1.0"?>
<interface>
<menu id="FilePlaceholder3">
<item>
<attribute name="label" translatable="yes">_Print Report</attribute>
<attribute name="action">GncPluginPageReportActions.FilePrintAction</attribute>
<attribute name="accel">&lt;Primary&gt;p</attribute>
<attribute name="tooltip" translatable="yes">Print the current report</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
</menu>
<menu id="EditPlaceholder6">
<item>
<attribute name="label" translatable="yes">_Report Options</attribute>
<attribute name="action">GncPluginPageReportActions.ReportOptionsAction</attribute>
<attribute name="tooltip" translatable="yes">Edit report style sheets</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
</menu>
<menu id="FilePlaceholder4">
<item>
<attribute name="label" translatable="yes">Export as P_DF...</attribute>
<attribute name="action">GncPluginPageReportActions.FilePrintPDFAction</attribute>
<attribute name="tooltip" translatable="yes">Export the current report as a PDF document</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
</menu>
<menu id="FilePlaceholder5">
<item>
<attribute name="label" translatable="yes">Export _Report</attribute>
<attribute name="action">GncPluginPageReportActions.ReportExportAction</attribute>
<attribute name="tooltip" translatable="yes">Export HTML-formatted report to file</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
</menu>
<menu id="ReportsPlaceholder1">
<item>
<attribute name="label" translatable="no">Save _Report Configuration</attribute>
<attribute name="action">GncPluginPageReportActions.ReportSaveAction</attribute>
<attribute name="accel">&lt;Primary&gt;&lt;Alt&gt;s</attribute>
<attribute name="tooltip" translatable="yes">Update the current report's saved configuration</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
<item>
<attribute name="label" translatable="no">Save Report Configuration As...</attribute>
<attribute name="action">GncPluginPageReportActions.ReportSaveAsAction</attribute>
<attribute name="accel">&lt;Primary&gt;&lt;Alt&gt;&lt;Shift&gt;s</attribute>
<attribute name="tooltip" translatable="yes">Add the current report's configuration to the 'Reports->Saved Report Configurations' menu</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
</menu>
<menu id="mainwin-popup">
<item>
<attribute name="label" translatable="no">_Test</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="label" translatable="yes">_Save</property>
<property name="action-name">gnc-plugin-basic-commands-actions.FileSaveAction</property>
<property name="tooltip-text" translatable="yes">Save the current file</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="label" translatable="yes">_Close</property>
<property name="action-name">mainwin.FileCloseAction</property>
<property name="tooltip-text" translatable="yes">Close the currently active page</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="label" translatable="yes">New _Invoice...</property>
<property name="action-name">gnc-plugin-business-actions.ToolbarNewInvoiceAction</property>
<property name="tooltip-text" translatable="yes">Open the New Invoice dialog</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>
<child>
<object class="GtkToolButton" id="but3">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Back</property>
<property name="action-name">GncPluginPageReportActions.ReportBackAction</property>
<property name="tooltip-text" translatable="yes">Move back one step in the history</property>
<property name="use-underline">True</property>
<property name="icon-name">go-previous</property>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
<object class="GtkToolButton" id="but4">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Forward</property>
<property name="action-name">GncPluginPageReportActions.ReportForwAction</property>
<property name="tooltip-text" translatable="yes">Move forward one step in the history</property>
<property name="use-underline">True</property>
<property name="icon-name">go-next</property>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
<object class="GtkToolButton" id="but5">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Reload</property>
<property name="action-name">GncPluginPageReportActions.ReportReloadAction</property>
<property name="tooltip-text" translatable="yes">Reload the current page</property>
<property name="use-underline">True</property>
<property name="icon-name">view-refresh</property>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
<object class="GtkToolButton" id="but6">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Stop</property>
<property name="action-name">GncPluginPageReportActions.ReportStopAction</property>
<property name="tooltip-text" translatable="yes">Cancel outstanding HTML requests</property>
<property name="use-underline">True</property>
<property name="icon-name">process-stop</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="but7">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">_Report Options</property>
<property name="action-name">GncPluginPageReportActions.ReportOptionsAction</property>
<property name="tooltip-text" translatable="yes">Edit report options</property>
<property name="use-underline">True</property>
<property name="icon-name">document-properties</property>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
<object class="GtkToggleToolButton" id="but8">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Save _Report Configuration</property>
<property name="action-name">GncPluginPageReportActions.ReportSaveAction</property>
<property name="tooltip-text" translatable="yes">Update the current report's saved configuration</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="but9">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Save Report Configuration As...</property>
<property name="action-name">GncPluginPageReportActions.ReportSaveAsAction</property>
<property name="tooltip-text" translatable="yes">Add the current report's configuration to the 'Reports->Saved Report Configurations' menu</property>
<property name="use-underline">True</property>
<property name="icon-name">document-save-as</property>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
<object class="GtkToolButton" id="but10">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Export _Report</property>
<property name="action-name">GncPluginPageReportActions.ReportExportAction</property>
<property name="tooltip-text" translatable="yes">Export HTML-formatted report to file</property>
<property name="use-underline">True</property>
<property name="icon-name">go-next</property>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
<object class="GtkToolButton" id="but11">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">_Print Report...</property>
<property name="action-name">GncPluginPageReportActions.FilePrintAction</property>
<property name="tooltip-text" translatable="yes">Print the current report</property>
<property name="use-underline">True</property>
<property name="icon-name">document-print</property>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
<object class="GtkToolButton" id="but12">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Export as P_DF...</property>
<property name="action-name">GncPluginPageReportActions.FilePrintPDFAction</property>
<property name="tooltip-text" translatable="yes">Export the current report as a PDF document</property>
<property name="use-underline">True</property>
<property name="icon-name">gnc-gnome-pdf</property>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
</object>
</interface>

View File

@ -1,20 +0,0 @@
<ui>
<menubar>
<placeholder name="AdditionalMenusPlaceholder">
<menu action="SxListAction">
<menuitem name="SxListNew" action="SxListNewAction"/>
<menuitem name="SxListEdit" action="SxListEditAction"/>
<menuitem name="SxListDelete" action="SxListDeleteAction"/>
</menu>
</placeholder>
</menubar>
<toolbar name="DefaultToolbar">
<placeholder name="DefaultToolbarPlaceholder">
<separator name="ToolbarSep2"/>
<toolitem name="SxListToolbarNew" action="SxListNewAction"/>
<toolitem name="SxListToolbarEdit" action="SxListEditAction"/>
<toolitem name="SxListToolbarDelete" action="SxListDeleteAction"/>
</placeholder>
</toolbar>
</ui>

View File

@ -0,0 +1,200 @@
<?xml version="1.0"?>
<interface>
<menu id="FilePlaceholder3">
<item>
<attribute name="label" translatable="yes">_Print</attribute>
<attribute name="action">mainwin.FilePrintAction</attribute>
<attribute name="accel">&lt;Primary&gt;p</attribute>
<attribute name="tooltip" translatable="yes">Print the currently active page</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
</menu>
<menu id="EditPlaceholder3">
<item>
<attribute name="label" translatable="yes">_Find...</attribute>
<attribute name="action">gnc-plugin-basic-commands-actions.EditFindTransactionsAction</attribute>
<attribute name="accel">&lt;Primary&gt;f</attribute>
<attribute name="tooltip" translatable="yes">Find transactions with a search</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
</menu>
<menu id="EditPlaceholder5">
<item>
<!-- Translators: remember to reuse this translation in dialog-account.glade -->
<attribute name="label" translatable="yes">Ta_x Report Options</attribute>
<attribute name="action">GncPluginPageSxListActions.EditTaxOptionsAction</attribute>
<!-- Translators: currently implemented are, US: income tax and DE: VAT, So adjust this string -->
<attribute name="tooltip" translatable="yes">Setup relevant accounts for tax reports, e.g. US income tax</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
</menu>
<menu id="ViewPlaceholder4">
<item>
<attribute name="label" translatable="yes">_Refresh</attribute>
<attribute name="action">GncPluginPageSxListActions.ViewRefreshAction</attribute>
<attribute name="accel">&lt;Primary&gt;r</attribute>
<attribute name="tooltip" translatable="yes">Refresh this window</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
</menu>
<menu id="SchedulePlaceholder0">
<item>
<attribute name="label" translatable="yes">_New</attribute>
<attribute name="action">GncPluginPageSxListActions.SxListNewAction</attribute>
<attribute name="tooltip" translatable="yes">Create a new scheduled transaction</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Edit</attribute>
<attribute name="action">GncPluginPageSxListActions.SxListEditAction</attribute>
<attribute name="tooltip" translatable="yes">Edit the selected scheduled transaction</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Delete</attribute>
<attribute name="action">GncPluginPageSxListActions.SxListDeleteAction</attribute>
<attribute name="tooltip" translatable="yes">Delete the selected scheduled transaction</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
</menu>
<menu id="mainwin-popup">
<item>
<attribute name="label" translatable="no">_Test</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="label" translatable="yes">_Save</property>
<property name="action-name">gnc-plugin-basic-commands-actions.FileSaveAction</property>
<property name="tooltip-text" translatable="yes">Save the current file</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="label" translatable="yes">_Close</property>
<property name="action-name">mainwin.FileCloseAction</property>
<property name="tooltip-text" translatable="yes">Close the currently active page</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="label" translatable="yes">New _Invoice...</property>
<property name="action-name">gnc-plugin-business-actions.ToolbarNewInvoiceAction</property>
<property name="tooltip-text" translatable="yes">Open the New Invoice dialog</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>
<child>
<object class="GtkToolButton" id="but3">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">_New</property>
<property name="action-name">GncPluginPageSxListActions.SxListNewAction</property>
<property name="tooltip-text" translatable="yes">Create a new scheduled transaction</property>
<property name="use-underline">True</property>
<property name="icon-name">gnc-account-open</property>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
<object class="GtkToolButton" id="but4">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">_Edit</property>
<property name="action-name">GncPluginPageSxListActions.SxListEditAction</property>
<property name="tooltip-text" translatable="yes">Edit the selected scheduled transaction</property>
<property name="use-underline">True</property>
<property name="icon-name">gnc-account-edit</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="but5">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">_Delete</property>
<property name="action-name">GncPluginPageSxListActions.SxListDeleteAction</property>
<property name="tooltip-text" translatable="yes">Delete the selected scheduled transaction</property>
<property name="use-underline">True</property>
<property name="icon-name">gnc-account-delete</property>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
</object>
</interface>

View File

@ -1,22 +0,0 @@
<ui>
<menubar>
<placeholder name="AdditionalMenusPlaceholder">
<menu action="SxListAction">
<menuitem name="SxListNew" action="SxListNewAction"/>
<menuitem name="SxListNew2" action="SxListNewAction2"/>
<menuitem name="SxListEdit" action="SxListEditAction"/>
<menuitem name="SxListEdit2" action="SxListEditAction2"/>
<menuitem name="SxListDelete" action="SxListDeleteAction"/>
</menu>
</placeholder>
</menubar>
<toolbar name="DefaultToolbar">
<placeholder name="DefaultToolbarPlaceholder">
<separator name="ToolbarSep2"/>
<toolitem name="SxListToolbarNew" action="SxListNewAction"/>
<toolitem name="SxListToolbarEdit" action="SxListEditAction"/>
<toolitem name="SxListToolbarDelete" action="SxListDeleteAction"/>
</placeholder>
</toolbar>
</ui>

View File

@ -1,54 +0,0 @@
<ui>
<menubar>
<menu name="Edit" action="EditAction">
<menuitem name="EditCut" action="EditCutAction"/>
<menuitem name="EditCopy" action="EditCopyAction"/>
<menuitem name="EditPaste" action="EditPasteAction"/>
</menu>
<menu name="Transaction" action="TransactionAction">
<menuitem name="CutTransaction" action="CutTransactionAction"/>
<menuitem name="CopyTransaction" action="CopyTransactionAction"/>
<menuitem name="PasteTransaction" action="PasteTransactionAction"/>
<menuitem name="DuplicateTransaction" action="DuplicateTransactionAction"/>
<menuitem name="DeleteTransaction" action="DeleteTransactionAction"/>
<menuitem name="RemoveTransactionSplits" action="RemoveTransactionSplitsAction"/>
<separator name="TransactionSep1"/>
<menuitem name="RecordTransaction" action="RecordTransactionAction"/>
<menuitem name="CancelTransaction" action="CancelTransactionAction"/>
</menu>
<menu name="View" action="ViewAction">
<placeholder name="ViewContentPlaceholder">
<menuitem name="ViewStyleDoubleLine" action="ViewStyleDoubleLineAction"/>
</placeholder>
</menu>
<menu name="Actions" action="ActionsAction">
<placeholder name="ActionsPlaceholder">
<menuitem name="BlankTransaction" action="BlankTransactionAction"/>
<menuitem name="SplitTransaction" action="SplitTransactionAction"/>
<menuitem name="EditExchangeRate" action="EditExchangeRateAction"/>
<menuitem name="ScheduleTransaction" action="ScheduleTransactionAction"/>
<menuitem name="JumpTransaction" action="JumpTransactionAction"/>
<separator name="ActionsSep5"/>
</placeholder>
</menu>
</menubar>
<toolbar name="DefaultToolbar">
<placeholder name="DefaultToolbarPlaceholder">
<toolitem name="ToolbarDuplicateTransaction" action="DuplicateTransactionAction"/>
<toolitem name="ToolbarDeleteTransaction" action="DeleteTransactionAction"/>
<separator name="ToolbarSep66"/>
<toolitem name="ToolbarRecordTransaction" action="RecordTransactionAction"/>
<toolitem name="ToolbarCancelTransaction" action="CancelTransactionAction"/>
<separator name="ToolbarSep67"/>
<toolitem name="ToolbarBlankTransaction" action="BlankTransactionAction"/>
<toolitem name="ToolbarSplitTransaction" action="SplitTransactionAction"/>
<toolitem name="ToolbarJumpTransaction" action="JumpTransactionAction"/>
<toolitem name="ToolbarScheduleTransaction" action="ScheduleTransactionAction"/>
</placeholder>
</toolbar>
</ui>

View File

@ -1,12 +0,0 @@
<ui>
<menubar>
<menu name="File" action="FileAction">
<menu name="FileImport" action="FileImportAction">
<placeholder name="FileImportPlaceholder">
<menuitem name="FileQIFImport" action="QIFImportAction"/>
<!-- menuitem name="FileQIFTestDruid" action="QIFTestDruid"/ -->
</placeholder>
</menu>
</menu>
</menubar>
</ui>

View File

@ -0,0 +1,12 @@
<?xml version="1.0"?>
<interface>
<menu id="FilePlaceholder1">
<item>
<attribute name="label" translatable="yes">Import _QIF...</attribute>
<attribute name="action">gnc-plugin-qif-import-actions.QIFImportAction</attribute>
<attribute name="tooltip" translatable="yes">Import a Quicken QIF file</attribute>
</item>
</menu>
</interface>

View File

@ -1,9 +0,0 @@
<ui>
<menubar>
<menu name="Tools" action="ToolsAction">
<placeholder name="ToolsPlaceholder">
<menuitem name="ToolsGeneralJournal" action="ToolsGeneralJournalAction"/>
</placeholder>
</menu>
</menubar>
</ui>

View File

@ -0,0 +1,12 @@
<?xml version="1.0"?>
<interface>
<menu id="ToolsPlaceholder2">
<item>
<attribute name="label" translatable="yes">_General Journal</attribute>
<attribute name="action">gnc-plugin-register-actions.ToolsGeneralJournalAction</attribute>
<attribute name="tooltip" translatable="yes">Open general journal window</attribute>
</item>
</menu>
</interface>

View File

@ -1,9 +0,0 @@
<ui>
<menubar>
<menu name="Edit" action="EditAction">
<placeholder name="EditStyleSheetsPlaceholder">
<menuitem name="EditStyleSheets" action="EditStyleSheetsAction"/>
</placeholder>
</menu>
</menubar>
</ui>

View File

@ -0,0 +1,12 @@
<?xml version="1.0"?>
<interface>
<menu id="EditPlaceholder4">
<item>
<attribute name="label" translatable="yes">St_yle Sheets</attribute>
<attribute name="action">gnc-plugin-report-system-actions.EditStyleSheetsAction</attribute>
<attribute name="tooltip" translatable="yes">Edit report style sheets</attribute>
</item>
</menu>
</interface>

View File

@ -1,54 +0,0 @@
<ui>
<menubar>
<menu name="Reconcile" action="ReconcileMenuAction">
<menuitem name="RecnChangeInfo" action="RecnChangeInfoAction"/>
<separator name="RecnSep1"/>
<menuitem name="RecnFinish" action="RecnFinishAction"/>
<menuitem name="RecnPostpone" action="RecnPostponeAction"/>
<menuitem name="RecnCancel" action="RecnCancelAction"/>
</menu>
<menu name="Account" action="AccountMenuAction">
<menuitem name="AccountOpenAccount" action="AccountOpenAccountAction"/>
<menuitem name="AccountEditAccount" action="AccountEditAccountAction"/>
<separator name="AccountSep1"/>
<menuitem name="AccountTransfer" action="AccountTransferAction"/>
<separator name="AccountSep2"/>
<menuitem name="AccountCheckRepair" action="AccountCheckRepairAction"/>
</menu>
<menu name="Transaction" action="TransactionMenuAction">
<menuitem name="TransNew" action="TransBalanceAction"/>
<menuitem name="TransEdit" action="TransEditAction"/>
<menuitem name="TransRec" action="TransRecAction"/>
<menuitem name="TransUnRec" action="TransUnRecAction"/>
<menuitem name="TransDelete" action="TransDeleteAction"/>
</menu>
<menu name="Help" action="HelpMenuAction">
<menuitem name="HelpHelp" action="HelpHelpAction"/>
</menu>
</menubar>
<popup name="MainPopup" action="FakeToplevel">
<menuitem name="TransNew" action="TransBalanceAction"/>
<menuitem name="TransEdit" action="TransEditAction"/>
<menuitem name="TransRec" action="TransRecAction"/>
<menuitem name="TransUnRec" action="TransUnRecAction"/>
<menuitem name="TransDelete" action="TransDeleteAction"/>
</popup>
<toolbar name="DefaultToolbar">
<toolitem name="TransNew" action="TransBalanceAction"/>
<toolitem name="TransEdit" action="TransEditAction"/>
<toolitem name="TransRec" action="TransRecAction"/>
<toolitem name="TransUnRec" action="TransUnRecAction"/>
<toolitem name="TransDelete" action="TransDeleteAction"/>
<separator name="ToolbarSep2"/>
<toolitem name="AccountOpenAccount" action="AccountOpenAccountAction"/>
<separator name="ToolbarSep3"/>
<toolitem name="RecnFinish" action="RecnFinishAction"/>
<toolitem name="RecnPostpone" action="RecnPostponeAction"/>
<toolitem name="RecnCancel" action="RecnCancelAction"/>
</toolbar>
</ui>

View File

@ -0,0 +1,289 @@
<?xml version="1.0"?>
<interface>
<menu id="recwin-menu">
<submenu>
<attribute name="label" translatable="yes">_Reconcile</attribute>
<section>
<item>
<attribute name="label" translatable="yes">_Reconcile Information...</attribute>
<attribute name="action">recwin.RecnChangeInfoAction</attribute>
</item>
</section>
<section>
<item>
<attribute name="label" translatable="yes">_Finish</attribute>
<attribute name="action">recwin.RecnFinishAction</attribute>
<attribute name="accel">&lt;Primary&gt;w</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Postpone</attribute>
<attribute name="action">recwin.RecnPostponeAction</attribute>
<attribute name="accel">&lt;Primary&gt;p</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Cancel</attribute>
<attribute name="action">recwin.RecnCancelAction</attribute>
</item>
</section>
</submenu>
<submenu>
<attribute name="label" translatable="yes">_Account</attribute>
<section>
<item>
<attribute name="label" translatable="yes">_Open Account</attribute>
<attribute name="action">recwin.AccountOpenAccountAction</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Edit Account</attribute>
<attribute name="action">recwin.AccountEditAccountAction</attribute>
</item>
</section>
<section>
<item>
<attribute name="label" translatable="yes">_Transfer...</attribute>
<attribute name="action">recwin.AccountTransferAction</attribute>
</item>
</section>
<section>
<item>
<attribute name="label" translatable="yes">_Check &amp; Repair</attribute>
<attribute name="action">recwin.AccountCheckRepairAction</attribute>
</item>
</section>
</submenu>
<submenu>
<attribute name="label" translatable="yes">_Transaction</attribute>
<section>
<item>
<attribute name="label" translatable="yes">_Balance</attribute>
<attribute name="action">recwin.TransBalanceAction</attribute>
<attribute name="accel">&lt;Primary&gt;b</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Edit</attribute>
<attribute name="action">recwin.TransEditAction</attribute>
<attribute name="accel">&lt;Primary&gt;e</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Reconcile Selection</attribute>
<attribute name="action">recwin.TransRecAction</attribute>
<attribute name="accel">&lt;Primary&gt;r</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Unreconcile Selection</attribute>
<attribute name="action">recwin.TransUnRecAction</attribute>
<attribute name="accel">&lt;Primary&gt;u</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Delete</attribute>
<attribute name="action">recwin.TransDeleteAction</attribute>
<attribute name="accel">&lt;Primary&gt;d</attribute>
</item>
</section>
</submenu>
<submenu>
<attribute name="label" translatable="yes">_Help</attribute>
<section>
<item>
<attribute name="label" translatable="yes">_Help</attribute>
<attribute name="action">recwin.HelpHelpAction</attribute>
</item>
</section>
</submenu>
</menu>
<menu id="recwin-popup">
<item>
<attribute name="label" translatable="yes">_Balance</attribute>
<attribute name="action">recwin.TransBalanceAction</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Edit</attribute>
<attribute name="action">recwin.TransEditAction</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Reconcile Selection</attribute>
<attribute name="action">recwin.TransRecAction</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Unreconcile Selection</attribute>
<attribute name="action">recwin.TransUnRecAction</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Delete</attribute>
<attribute name="action">recwin.TransDeleteAction</attribute>
</item>
</menu>
<object class="GtkToolbar" id="recwin-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">Add a new balancing entry to the account</property>
<property name="action-name">recwin.TransBalanceAction</property>
<property name="label" translatable="yes">_Balance</property>
<property name="use-underline">True</property>
<property name="icon-name">document-new</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="action-name">recwin.TransEditAction</property>
<property name="tooltip-text" translatable="yes">Edit the current transaction</property>
<property name="label" translatable="yes">_Edit</property>
<property name="use-underline">True</property>
<property name="icon-name">document-properties</property>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
<object class="GtkToolButton" id="but3">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="tooltip-text" translatable="yes">Reconcile the selected transactions</property>
<property name="action-name">recwin.TransRecAction</property>
<property name="label" translatable="yes">Reconcile Selection</property>
<property name="use-underline">True</property>
<property name="icon-name">emblem-default</property>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
<object class="GtkToolButton" id="but4">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="tooltip-text" translatable="yes">Unreconcile the selected transactions</property>
<property name="action-name">recwin.TransUnRecAction</property>
<property name="label" translatable="yes">Unreconcile Selection</property>
<property name="use-underline">True</property>
<property name="icon-name">edit-clear</property>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
<object class="GtkToolButton" id="but5">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="tooltip-text" translatable="yes">Delete the selected transaction</property>
<property name="action-name">recwin.TransDeleteAction</property>
<property name="label" translatable="yes">_Delete</property>
<property name="use-underline">True</property>
<property name="icon-name">edit-delete</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="but6">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="tooltip-text" translatable="yes">Open the account</property>
<property name="action-name">recwin.AccountOpenAccountAction</property>
<property name="label" translatable="yes">_Open</property>
<property name="use-underline">True</property>
<property name="icon-name">go-jump</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="but7">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="tooltip-text" translatable="yes">Finish the reconciliation of this account</property>
<property name="action-name">recwin.RecnFinishAction</property>
<property name="label" translatable="yes">_Finish</property>
<property name="use-underline">True</property>
<property name="icon-name">system-run</property>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
<object class="GtkToolButton" id="but8">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="tooltip-text" translatable="yes">Postpone the reconciliation of this account</property>
<property name="action-name">recwin.RecnPostponeAction</property>
<property name="label" translatable="yes">_Postpone</property>
<property name="use-underline">True</property>
<property name="icon-name">go-previous</property>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
<object class="GtkToolButton" id="but9">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="tooltip-text" translatable="yes">Cancel the reconciliation of this account</property>
<property name="action-name">recwin.RecnCancelAction</property>
<property name="label" translatable="yes">_Cancel</property>
<property name="use-underline">True</property>
<property name="icon-name">process-stop</property>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
</object>
</interface>

View File

@ -1,3 +0,0 @@
<ui>
<!-- there is no "chrome" besides the (read-only) register itself, here. -->
</ui>

View File

@ -1,62 +0,0 @@
<ui>
<menubar>
<menu name="Edit" action="EditAction">
<menuitem name="EditCut" action="EditCutAction"/>
<menuitem name="EditCopy" action="EditCopyAction"/>
<menuitem name="EditPaste" action="EditPasteAction"/>
</menu>
<menu name="Transaction" action="TransactionAction">
<menuitem name="CutTransaction" action="CutTransactionAction"/>
<menuitem name="CopyTransaction" action="CopyTransactionAction"/>
<menuitem name="PasteTransaction" action="PasteTransactionAction"/>
<menuitem name="DuplicateTransaction" action="DuplicateTransactionAction"/>
<menuitem name="DeleteTransaction" action="DeleteTransactionAction"/>
<menuitem name="RemoveTransactionSplits" action="RemoveTransactionSplitsAction"/>
<separator name="TransactionSep1"/>
<menuitem name="RecordTransaction" action="RecordTransactionAction"/>
<menuitem name="CancelTransaction" action="CancelTransactionAction"/>
</menu>
<menu name="View" action="ViewAction">
<placeholder name="ViewContentPlaceholder">
<menuitem name="ViewStyleDoubleLine" action="ViewStyleDoubleLineAction"/>
</placeholder>
</menu>
<menu name="Actions" action="ActionsAction">
<placeholder name="ActionsPlaceholder">
<separator name="ActionsSep1"/>
<menuitem name="ActionsTransfer" action="ActionsTransferAction"/>
<separator name="ActionsSep4"/>
<menuitem name="BlankTransaction" action="BlankTransactionAction"/>
</placeholder>
</menu>
</menubar>
<toolbar name="DefaultToolbar">
<placeholder name="DefaultToolbarPlaceholder">
<toolitem name="ToolbarDuplicateTransaction" action="DuplicateTransactionAction"/>
<toolitem name="ToolbarDeleteTransaction" action="DeleteTransactionAction"/>
<separator name="ToolbarSep66"/>
<toolitem name="ToolbarRecordTransaction" action="RecordTransactionAction"/>
<toolitem name="ToolbarCancelTransaction" action="CancelTransactionAction"/>
<separator name="ToolbarSep67"/>
<toolitem name="ToolbarBlankTransaction" action="BlankTransactionAction"/>
<separator name="ToolbarSep68"/>
</placeholder>
</toolbar>
<popup name="MainPopup" action="FakeToplevel">
<placeholder name="PopupPlaceholder2">
<menuitem name="DuplicateTransaction" action="DuplicateTransactionAction"/>
<menuitem name="DeleteTransaction" action="DeleteTransactionAction"/>
<menuitem name="RemoveTransactionSplits" action="RemoveTransactionSplitsAction"/>
<separator name="PopupSep2"/>
<menuitem name="RecordTransaction" action="RecordTransactionAction"/>
<menuitem name="CancelTransaction" action="CancelTransactionAction"/>
<separator name="PopupSep3"/>
<menuitem name="BlankTransaction" action="BlankTransactionAction"/>
</placeholder>
</popup>
</ui>

View File

@ -1,3 +0,0 @@
<ui>
<!-- nothing -->
</ui>

View File

@ -1,11 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<ui>
<menubar>
<menu name="Windows" action="WindowsAction">
<menuitem name="WindowNew" action="WindowNewAction"/>
<menuitem name="WindowMovePage" action="WindowMovePageAction"/>
<separator name="ViewSep4"/>
<placeholder name="WindowsPlaceholder"/>
</menu>
</menubar>
</ui>

Some files were not shown because too many files have changed in this diff Show More