mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
2002-11-15 Joshua Sled <jsled@asynchronous.org>
* src/gnome/window-register.c (gnc_register_delete_cb): Change the order of window deletion to not cause a crash. * src/gnome/window-register.c (regWindowSimple), (regWindowAccGroup): Only return the GNCSplitReg, not the whole regData. Fixes a bunch of existing and potential crashes. * src/gnome/window-main.c (gnc_main_window_gl_cb): * src/gnome/window-acct-tree.c (gnc_acct_tree_window_toolbar_open_cb) (gnc_acct_tree_window_menu_open_subs_cb) (gnc_acct_tree_window_menu_open_cb) (gnc_acct_tree_window_activate_cb): * src/gnome/top-level.c (gnc_html_register_url_cb): Modify to not necessarily expect a RegWindow for creation of a ledger view. Fixes a bunch of existing and potential crashes. * src/gnome/gnc-split-reg.c (gnc_split_reg_delete_cb): Removed; dead. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@7484 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
3f77e88597
commit
d4f97ce2d9
23
ChangeLog
23
ChangeLog
@ -1,3 +1,25 @@
|
||||
2002-11-15 Joshua Sled <jsled@asynchronous.org>
|
||||
|
||||
* src/gnome/window-register.c (gnc_register_delete_cb): Change the
|
||||
order of window deletion to not cause a crash.
|
||||
|
||||
* src/gnome/window-register.c (regWindowSimple),
|
||||
(regWindowAccGroup): Only return the GNCSplitReg, not the whole
|
||||
regData. Fixes a bunch of existing and potential crashes.
|
||||
|
||||
* src/gnome/window-main.c (gnc_main_window_gl_cb):
|
||||
* src/gnome/window-acct-tree.c
|
||||
(gnc_acct_tree_window_toolbar_open_cb)
|
||||
(gnc_acct_tree_window_menu_open_subs_cb)
|
||||
(gnc_acct_tree_window_menu_open_cb)
|
||||
(gnc_acct_tree_window_activate_cb):
|
||||
* src/gnome/top-level.c (gnc_html_register_url_cb):
|
||||
Modify to not necessarily expect a RegWindow for creation of a
|
||||
ledger view. Fixes a bunch of existing and potential crashes.
|
||||
|
||||
* src/gnome/gnc-split-reg.c (gnc_split_reg_delete_cb): Removed;
|
||||
dead.
|
||||
|
||||
2002-11-14 David Hampton <hampton@employees.org>
|
||||
|
||||
* src/register/ledger-core/split-register.c:
|
||||
@ -132,7 +154,6 @@
|
||||
transaction matcher UI changes. Create a pseudo-widget in first
|
||||
column to select the action to be taken with the transaction.
|
||||
|
||||
>>>>>>> 1.1149
|
||||
2002-11-12 Joshua Sled <jsled@asynchronous.org>
|
||||
|
||||
* src/gnome/dialog-sxsincelast.c
|
||||
|
@ -181,9 +181,6 @@ void gnc_split_reg_sort_amount_cb (GtkWidget *w, gpointer data);
|
||||
void gnc_split_reg_sort_memo_cb (GtkWidget *w, gpointer data);
|
||||
void gnc_split_reg_sort_desc_cb (GtkWidget *w, gpointer data);
|
||||
|
||||
gboolean gnc_split_reg_delete_cb( GtkWidget *widget,
|
||||
GdkEvent *event,
|
||||
gpointer data );
|
||||
void gnc_split_reg_destroy_cb(GtkWidget *widget, gpointer data);
|
||||
void gnc_split_reg_size_allocate( GtkWidget *widget,
|
||||
GtkAllocation *allocation,
|
||||
@ -1701,15 +1698,6 @@ gnc_split_reg_record_cb (GnucashRegister *reg, gpointer data)
|
||||
gsr_emit_signal( (GNCSplitReg*)data, "enter_ent" );
|
||||
}
|
||||
|
||||
gboolean
|
||||
gnc_split_reg_delete_cb(GtkWidget *widget, GdkEvent *event, gpointer data)
|
||||
{
|
||||
GNCSplitReg *gsr = data;
|
||||
gnc_split_reg_check_close( gsr );
|
||||
gnc_ledger_display_close( gsr->ledger );
|
||||
return TRUE; /* don't close */
|
||||
}
|
||||
|
||||
void
|
||||
gnc_split_reg_size_allocate (GtkWidget *widget,
|
||||
GtkAllocation *allocation,
|
||||
|
@ -268,6 +268,8 @@ GtkWidget *gnc_split_reg_get_popup_extended( GNCSplitReg *gsr );
|
||||
|
||||
gboolean gnc_split_reg_check_close( GNCSplitReg *gsr );
|
||||
|
||||
void gnc_split_reg_raise( GNCSplitReg *gsr );
|
||||
|
||||
/*
|
||||
* Function to jump to various places in the register
|
||||
*/
|
||||
|
@ -52,6 +52,7 @@
|
||||
#include "gnc-gnome-utils.h"
|
||||
#include "gnc-gpg.h"
|
||||
#include "gnc-report.h"
|
||||
#include "gnc-split-reg.h"
|
||||
#include "gnc-ui.h"
|
||||
#include "gnucash-color.h"
|
||||
#include "gnucash-sheet.h"
|
||||
@ -135,7 +136,7 @@ static gboolean
|
||||
gnc_html_register_url_cb (const char *location, const char *label,
|
||||
gboolean new_window, GNCURLResult *result)
|
||||
{
|
||||
RegWindow * reg = NULL;
|
||||
GNCSplitReg * gsr = NULL;
|
||||
Split * split = NULL;
|
||||
Account * account;
|
||||
Transaction * trans;
|
||||
@ -152,8 +153,8 @@ gnc_html_register_url_cb (const char *location, const char *label,
|
||||
account = xaccGetAccountFromFullName (gnc_get_current_group (),
|
||||
location + 8,
|
||||
gnc_get_account_separator ());
|
||||
reg = regWindowSimple (account);
|
||||
gnc_register_raise (reg);
|
||||
gsr = regWindowSimple (account);
|
||||
gnc_split_reg_raise( gsr );
|
||||
}
|
||||
/* href="gnc-register:guid=12345678901234567890123456789012" */
|
||||
else if (strncmp ("guid=", location, 5) == 0)
|
||||
@ -177,7 +178,7 @@ gnc_html_register_url_cb (const char *location, const char *label,
|
||||
else if (!safe_strcmp (id_type, GNC_ID_ACCOUNT))
|
||||
{
|
||||
account = xaccAccountLookup (&guid, gnc_get_current_book ());
|
||||
reg = regWindowSimple (account);
|
||||
gsr = regWindowSimple( account );
|
||||
}
|
||||
else if (!safe_strcmp (id_type, GNC_ID_TRANS))
|
||||
{
|
||||
@ -198,7 +199,7 @@ gnc_html_register_url_cb (const char *location, const char *label,
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
reg = regWindowSimple (xaccSplitGetAccount (split));
|
||||
gsr = regWindowSimple( xaccSplitGetAccount(split) );
|
||||
}
|
||||
else if (!safe_strcmp (id_type, GNC_ID_SPLIT))
|
||||
{
|
||||
@ -210,7 +211,7 @@ gnc_html_register_url_cb (const char *location, const char *label,
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
reg = regWindowSimple (xaccSplitGetAccount (split));
|
||||
gsr = regWindowSimple( xaccSplitGetAccount(split) );
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -219,9 +220,9 @@ gnc_html_register_url_cb (const char *location, const char *label,
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
gnc_register_raise(reg);
|
||||
gnc_split_reg_raise(gsr);
|
||||
if (split)
|
||||
gnc_register_jump_to_split (reg, split);
|
||||
gnc_split_reg_jump_to_split( gsr, split );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -42,6 +42,7 @@
|
||||
#include "gnc-engine.h"
|
||||
#include "gnc-gui-query.h"
|
||||
#include "gnc-html.h"
|
||||
#include "gnc-split-reg.h"
|
||||
#include "gnc-ui.h"
|
||||
#include "gtkselect.h"
|
||||
#include "io-gncxml-v2.h"
|
||||
@ -340,7 +341,7 @@ gnc_main_window_open_accounts(gboolean toplevel)
|
||||
static void
|
||||
gnc_acct_tree_window_toolbar_open_cb (GtkWidget *widget, gpointer data)
|
||||
{
|
||||
RegWindow *regData;
|
||||
GNCSplitReg *gsr;
|
||||
GNCAcctTreeWin * win = data;
|
||||
Account * account = gnc_acct_tree_window_get_current_account(win);
|
||||
|
||||
@ -354,8 +355,8 @@ gnc_acct_tree_window_toolbar_open_cb (GtkWidget *widget, gpointer data)
|
||||
|
||||
PINFO ("calling regWindowSimple(%p)\n", account);
|
||||
|
||||
regData = regWindowSimple(account);
|
||||
gnc_register_raise(regData);
|
||||
gsr = regWindowSimple(account);
|
||||
gnc_split_reg_raise( gsr );
|
||||
}
|
||||
|
||||
static void
|
||||
@ -491,7 +492,7 @@ gnc_acct_tree_window_menu_open_subs_cb(GtkWidget * widget,
|
||||
GNCMDIInfo * info)
|
||||
{
|
||||
Account *account;
|
||||
RegWindow *regData;
|
||||
GNCSplitReg *gsr;
|
||||
|
||||
account = gnc_acct_tree_find_account_from_gncmdi(info);
|
||||
if (account == NULL) {
|
||||
@ -503,8 +504,8 @@ gnc_acct_tree_window_menu_open_subs_cb(GtkWidget * widget,
|
||||
else {
|
||||
PINFO ("calling regWindowAccGroup(%p)\n", account);
|
||||
|
||||
regData = regWindowAccGroup(account);
|
||||
gnc_register_raise(regData);
|
||||
gsr = regWindowAccGroup(account);
|
||||
gnc_split_reg_raise(gsr);
|
||||
}
|
||||
}
|
||||
|
||||
@ -655,7 +656,7 @@ static void
|
||||
gnc_acct_tree_window_menu_open_cb (GtkWidget *widget, GNCMDIInfo * info)
|
||||
{
|
||||
Account *account;
|
||||
RegWindow *regData;
|
||||
GNCSplitReg *gsr;
|
||||
|
||||
account = gnc_acct_tree_find_account_from_gncmdi(info);
|
||||
if (account == NULL) {
|
||||
@ -667,8 +668,8 @@ gnc_acct_tree_window_menu_open_cb (GtkWidget *widget, GNCMDIInfo * info)
|
||||
else {
|
||||
PINFO ("calling regWindowSimple(%p)\n", account);
|
||||
|
||||
regData = regWindowSimple(account);
|
||||
gnc_register_raise(regData);
|
||||
gsr = regWindowSimple(account);
|
||||
gnc_split_reg_raise(gsr);
|
||||
}
|
||||
}
|
||||
|
||||
@ -679,7 +680,7 @@ gnc_acct_tree_window_activate_cb(GNCMainWinAccountTree *tree,
|
||||
gpointer user_data)
|
||||
{
|
||||
GNCAcctTreeWin * win = user_data;
|
||||
RegWindow *regData;
|
||||
GNCSplitReg *gsr;
|
||||
gboolean expand;
|
||||
|
||||
expand =
|
||||
@ -700,8 +701,8 @@ gnc_acct_tree_window_activate_cb(GNCMainWinAccountTree *tree,
|
||||
}
|
||||
}
|
||||
|
||||
regData = regWindowSimple(account);
|
||||
gnc_register_raise(regData);
|
||||
gsr = regWindowSimple(account);
|
||||
gnc_split_reg_raise(gsr);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -53,6 +53,7 @@
|
||||
#include "gnc-file.h"
|
||||
#include "gnc-gui-query.h"
|
||||
#include "gnc-menu-extensions.h"
|
||||
#include "gnc-split-reg.h"
|
||||
#include "gnc-ui.h"
|
||||
#include "guile-util.h"
|
||||
#include "mainwindow-account-tree.h"
|
||||
@ -623,13 +624,17 @@ void
|
||||
gnc_main_window_gl_cb(GtkWidget *widget, gpointer data)
|
||||
{
|
||||
GNCLedgerDisplay *ld;
|
||||
GNCSplitReg *gsr;
|
||||
RegWindow *regData;
|
||||
|
||||
ld = gnc_ledger_display_gl ();
|
||||
|
||||
gsr = gnc_ledger_display_get_user_data( ld );
|
||||
if ( ! gsr ) {
|
||||
regData = regWindowLedger (ld);
|
||||
|
||||
gnc_register_raise (regData);
|
||||
} else {
|
||||
gnc_split_reg_raise( gsr );
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
@ -694,16 +699,16 @@ gnc_main_window_about_cb (GtkWidget *widget, gpointer data)
|
||||
"http://www.gnucash.org/");
|
||||
const gchar *copyright = "(C) 1998-2002 Linas Vepstas";
|
||||
const gchar *authors[] = {
|
||||
"Derek Atkins <derek@ihtfp.com>",
|
||||
"Rob Browning <rlb@cs.utexas.edu>",
|
||||
"Bill Gribble <grib@billgribble.com>",
|
||||
"David Hampton <hampton@employees.org>",
|
||||
"James LewisMoss <dres@debian.org>",
|
||||
"Robert Graham Merkel <rgmerk@mira.net>",
|
||||
"Dave Peticolas <dave@krondo.com>",
|
||||
"Joshua Sled <jsled@asynchronous.org>",
|
||||
"Christian Stimming <stimming@tuhh.de>",
|
||||
"Linas Vepstas <linas@linas.org>",
|
||||
"Joshua Sled <jsled@asynchronous.org>",
|
||||
"Derek Atkins <derek@ihtfp.com>",
|
||||
"David Hampton <hampton@employees.org>",
|
||||
NULL
|
||||
};
|
||||
|
||||
|
@ -194,15 +194,22 @@ static void gnc_reg_save_size (RegWindow *regData);
|
||||
* Args: account - the account associated with this register *
|
||||
* Return: regData - the register window instance *
|
||||
\********************************************************************/
|
||||
RegWindow *
|
||||
GNCSplitReg*
|
||||
regWindowSimple (Account *account)
|
||||
{
|
||||
GNCSplitReg *gsr;
|
||||
GNCLedgerDisplay * ledger = gnc_ledger_display_simple( account );
|
||||
|
||||
if (ledger == NULL)
|
||||
return NULL;
|
||||
|
||||
return regWindowLedger( ledger );
|
||||
gsr = gnc_ledger_display_get_user_data( ledger );
|
||||
if ( !gsr ) {
|
||||
RegWindow *rw = regWindowLedger( ledger );
|
||||
gsr = rw->gsr;
|
||||
}
|
||||
|
||||
return gsr;
|
||||
}
|
||||
|
||||
|
||||
@ -213,15 +220,23 @@ regWindowSimple (Account *account)
|
||||
* Args: account - the account associated with this register *
|
||||
* Return: regData - the register window instance *
|
||||
\********************************************************************/
|
||||
RegWindow *
|
||||
GNCSplitReg*
|
||||
regWindowAccGroup (Account *account)
|
||||
{
|
||||
GNCSplitReg *gsr;
|
||||
GNCLedgerDisplay * ledger = gnc_ledger_display_subaccounts (account);
|
||||
|
||||
if (ledger == NULL)
|
||||
return NULL;
|
||||
|
||||
return regWindowLedger (ledger);
|
||||
gsr = gnc_ledger_display_get_user_data( ledger );
|
||||
if ( !gsr ) {
|
||||
RegWindow *rw;
|
||||
rw = regWindowLedger (ledger);
|
||||
gsr = rw->gsr;
|
||||
}
|
||||
|
||||
return gsr;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -650,13 +665,13 @@ gnc_register_delete_cb(GtkWidget *widget, GdkEvent *event, gpointer data)
|
||||
{
|
||||
RegWindow *regData = data;
|
||||
|
||||
gnc_split_reg_check_close(regData->gsr);
|
||||
gnc_ledger_display_close (regData->ledger);
|
||||
|
||||
if ( regData ) {
|
||||
gnc_reg_save_size( regData );
|
||||
}
|
||||
|
||||
gnc_split_reg_check_close(regData->gsr);
|
||||
gnc_ledger_display_close (regData->ledger);
|
||||
|
||||
return TRUE; /* don't close */
|
||||
}
|
||||
|
||||
@ -1495,7 +1510,7 @@ gnc_register_gl_cb(GtkWidget *widget, gpointer data)
|
||||
|
||||
ld = gnc_ledger_display_gl();
|
||||
regData = regWindowLedger( ld );
|
||||
gnc_register_raise( regData );
|
||||
gnc_split_reg_raise( regData->gsr );
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -25,6 +25,7 @@
|
||||
#define WINDOW_REGISTER_H
|
||||
|
||||
#include "gnc-ledger-display.h"
|
||||
#include "gnc-split-reg.h"
|
||||
|
||||
/** STRUCTS *********************************************************/
|
||||
typedef struct _RegWindow RegWindow;
|
||||
@ -33,8 +34,9 @@ GtkWidget *gnc_RegWindow_window (RegWindow *data);
|
||||
GNCLedgerDisplay *gnc_RegWindow_ledger (RegWindow *data);
|
||||
|
||||
/** PROTOTYPES ******************************************************/
|
||||
RegWindow * regWindowSimple(Account *account);
|
||||
RegWindow * regWindowAccGroup(Account *account_group);
|
||||
GNCSplitReg* regWindowSimple(Account *account);
|
||||
GNCSplitReg* regWindowAccGroup(Account *account_group);
|
||||
|
||||
RegWindow* regWindowLedger(GNCLedgerDisplay *ledger);
|
||||
|
||||
gpointer gnc_RegWindow_get_pcd (RegWindow *data);
|
||||
|
Loading…
Reference in New Issue
Block a user