mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Can now open arbitrary account registers.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/branches/gnucash-gnome2-dev@9302 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
19
ChangeLog
19
ChangeLog
@@ -1,3 +1,22 @@
|
||||
2003-09-13 David Hampton <hampton@employees.org>
|
||||
|
||||
* src/gnome/gnc-main-window.c: Collapse common functions into one.
|
||||
|
||||
* src/gnome/gnc-main-window.c:
|
||||
* src/gnome/gnc-plugin-page-account-tree.c:
|
||||
* src/gnome/gnc-plugin-page-register.[ch]:
|
||||
* src/gnome/gnc-plugin-page.[ch]: Add new vector for getting the
|
||||
window title. The tab_name vector no loner returns a const
|
||||
string.
|
||||
|
||||
* src/gnome/gnc-main-window.c: Always bring a new page to the top
|
||||
of the stack. Remove unused code.
|
||||
|
||||
* src/gnome/gnc-plugin-page-account-tree.c:
|
||||
* src/gnome/gnc-plugin-page-register.[ch]:
|
||||
* src/gnome/gnc-plugin-register.c: Can now open arbitrary account
|
||||
registers.
|
||||
|
||||
2003-09-09 David Hampton <hampton@employees.org>
|
||||
|
||||
* src/gnome-search/dialog-search.c:
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#include "egg-action-group.h"
|
||||
|
||||
#include "gnc-plugin-page-account-tree.h"
|
||||
#include "gnc-plugin-page-register.h"
|
||||
|
||||
#include "AccWindow.h"
|
||||
#include "Scrub.h"
|
||||
@@ -652,25 +653,45 @@ gnc_plugin_page_account_tree_cmd_new_account (EggAction *action, GncPluginPageAc
|
||||
static void
|
||||
gnc_plugin_page_account_tree_cmd_open_account (EggAction *action, GncPluginPageAccountTree *page)
|
||||
{
|
||||
Account *account = gnc_plugin_page_account_tree_get_current_account (page);
|
||||
GNCSplitReg *gsr;
|
||||
GncMainWindow *window;
|
||||
GncPluginPage *new_page;
|
||||
GtkWidget *widget;
|
||||
Account *account;
|
||||
|
||||
g_return_if_fail (account != NULL);
|
||||
g_return_if_fail (GNC_IS_PLUGIN_PAGE_ACCOUNT_TREE (page));
|
||||
account = gnc_plugin_page_account_tree_get_current_account (page);
|
||||
if (account == NULL)
|
||||
return;
|
||||
|
||||
gsr = regWindowSimple (account);
|
||||
gnc_split_reg_raise (gsr);
|
||||
widget = page->priv->widget;
|
||||
window = GNC_MAIN_WINDOW(g_object_get_data (G_OBJECT (widget), "window"));
|
||||
if (window == NULL)
|
||||
return;
|
||||
|
||||
new_page = gnc_plugin_page_register_new (account, FALSE);
|
||||
gnc_main_window_open_page (window, new_page);
|
||||
}
|
||||
|
||||
static void
|
||||
gnc_plugin_page_account_tree_cmd_open_subaccounts (EggAction *action, GncPluginPageAccountTree *page)
|
||||
{
|
||||
Account *account = gnc_plugin_page_account_tree_get_current_account (page);
|
||||
GNCSplitReg *gsr;
|
||||
GncMainWindow *window;
|
||||
GncPluginPage *new_page;
|
||||
GtkWidget *widget;
|
||||
Account *account;
|
||||
|
||||
g_return_if_fail (account != NULL);
|
||||
g_return_if_fail (GNC_IS_PLUGIN_PAGE_ACCOUNT_TREE (page));
|
||||
account = gnc_plugin_page_account_tree_get_current_account (page);
|
||||
if (account == NULL)
|
||||
return;
|
||||
|
||||
gsr = regWindowAccGroup (account);
|
||||
gnc_split_reg_raise (gsr);
|
||||
widget = page->priv->widget;
|
||||
window = GNC_MAIN_WINDOW(g_object_get_data (G_OBJECT (widget), "window"));
|
||||
if (window == NULL)
|
||||
return;
|
||||
|
||||
new_page = gnc_plugin_page_register_new (account, TRUE);
|
||||
gnc_main_window_open_page (window, new_page);
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
@@ -136,12 +136,33 @@ gnc_plugin_page_register_get_type (void)
|
||||
}
|
||||
|
||||
GncPluginPage *
|
||||
gnc_plugin_page_register_new (GNCLedgerDisplay *ld)
|
||||
gnc_plugin_page_register_new (Account *account, gboolean subaccounts)
|
||||
{
|
||||
GncPluginPageRegister *plugin_page;
|
||||
GNCLedgerDisplay *ld;
|
||||
|
||||
plugin_page = g_object_new (GNC_TYPE_PLUGIN_PAGE_REGISTER,
|
||||
NULL);
|
||||
|
||||
if (subaccounts)
|
||||
ld = gnc_ledger_display_subaccounts (account);
|
||||
else
|
||||
ld = gnc_ledger_display_simple (account);
|
||||
plugin_page->priv->ld = ld;
|
||||
|
||||
return GNC_PLUGIN_PAGE (plugin_page);
|
||||
}
|
||||
|
||||
GncPluginPage *
|
||||
gnc_plugin_page_register_new_gl (void)
|
||||
{
|
||||
GncPluginPageRegister *plugin_page;
|
||||
GNCLedgerDisplay *ld;
|
||||
|
||||
plugin_page = g_object_new (GNC_TYPE_PLUGIN_PAGE_REGISTER,
|
||||
NULL);
|
||||
|
||||
ld = gnc_ledger_display_gl ();
|
||||
plugin_page->priv->ld = ld;
|
||||
|
||||
return GNC_PLUGIN_PAGE (plugin_page);
|
||||
|
||||
@@ -30,8 +30,6 @@
|
||||
#include "Account.h"
|
||||
#include "gnc-plugin-page.h"
|
||||
|
||||
#include "gnc-ledger-display.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
/* type macros */
|
||||
@@ -60,7 +58,8 @@ typedef struct {
|
||||
/* function prototypes */
|
||||
GType gnc_plugin_page_register_get_type (void);
|
||||
|
||||
GncPluginPage *gnc_plugin_page_register_new (GNCLedgerDisplay *ld);
|
||||
GncPluginPage *gnc_plugin_page_register_new (Account *account, gboolean subaccounts);
|
||||
GncPluginPage *gnc_plugin_page_register_new_gl (void);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
#include <string.h>
|
||||
|
||||
#include "gnc-plugin-register.h"
|
||||
|
||||
#include "gnc-plugin-page-register.h"
|
||||
|
||||
#include "messages.h"
|
||||
@@ -194,14 +193,11 @@ gnc_plugin_register_create_page (GncPlugin *plugin,
|
||||
static void
|
||||
gnc_plugin_register_cmd_general_ledger (EggAction *action, GncMainWindowActionData *data)
|
||||
{
|
||||
GNCLedgerDisplay *ld;
|
||||
|
||||
GncPluginPage *page;
|
||||
|
||||
g_return_if_fail (data != NULL);
|
||||
|
||||
ld = gnc_ledger_display_gl ();
|
||||
page = gnc_plugin_page_register_new (ld);
|
||||
page = gnc_plugin_page_register_new_gl ();
|
||||
gnc_main_window_open_page (data->window, page);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user