* src/guile/gnc-helpers.c: more work on scm<->query.

* src/gnome/window-report.c: raise app of new report to top

	* src/register/recncell.c: add confirmation callback

	* src/SplitLedger.c: implement reconcile confirm cb

	* src/gnome/gnc-html.c: add missing include

	* src/gnome/dialog-transfer.c: fix spelling


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4002 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Dave Peticolas 2001-04-21 10:37:01 +00:00
parent 842fb1a89a
commit 274409e58a
8 changed files with 69 additions and 28 deletions

View File

@ -1,3 +1,19 @@
2001-04-21 Dave Peticolas <dave@krondo.com>
* src/guile/gnc-helpers.c: more work on scm<->query.
2001-04-20 Dave Peticolas <dave@krondo.com>
* src/gnome/window-report.c: raise app of new report to top
* src/register/recncell.c: add confirmation callback
* src/SplitLedger.c: implement reconcile confirm cb
* src/gnome/gnc-html.c: add missing include
* src/gnome/dialog-transfer.c: fix spelling
2001-04-20 Bill Gribble <grib@billgribble.com> 2001-04-20 Bill Gribble <grib@billgribble.com>
* src/gnome/dialog-column-view.c: maintain the report window * src/gnome/dialog-column-view.c: maintain the report window

View File

@ -45,7 +45,6 @@ src/gnome/window-register.c
src/gnome/window-report.c src/gnome/window-report.c
src/guile/gnucash.c src/guile/gnucash.c
src/register/gnome/gnucash-style.c src/register/gnome/gnucash-style.c
src/register/recncell.c
src/register/splitreg.c src/register/splitreg.c
src/scm/gnumeric/guile-strings.c src/scm/gnumeric/guile-strings.c
src/scm/guile-strings.c src/scm/guile-strings.c

View File

@ -4471,6 +4471,30 @@ xaccSRConfirmHandler (VirtualLocation virt_loc,
return TRUE; return TRUE;
} }
static gboolean
recn_cell_confirm (char old_flag, gpointer data)
{
SplitRegister *reg = data;
if (old_flag == YREC)
{
const char *message = _("Do you really want to mark this transaction "
"not reconciled?\nDoing so might make future "
"reconciliation difficult!");
gboolean confirm;
confirm = gnc_lookup_boolean_option ("Register",
"Confirm before changing reconciled",
TRUE);
if (!confirm)
return TRUE;
return gnc_verify_dialog_parented (xaccSRGetParent (reg), message, TRUE);
}
return TRUE;
}
/* ======================================================== */ /* ======================================================== */
G_INLINE_FUNC void G_INLINE_FUNC void
@ -4916,8 +4940,8 @@ xaccSRLoadRegister (SplitRegister *reg, GList * slist,
xaccComboCellSetCompleteChar (reg->mxfrmCell, account_separator); xaccComboCellSetCompleteChar (reg->mxfrmCell, account_separator);
xaccComboCellSetCompleteChar (reg->xfrmCell, account_separator); xaccComboCellSetCompleteChar (reg->xfrmCell, account_separator);
/* set the dialog parent for the reconcile cell */ /* set the confirmation callback for the reconcile cell */
xaccRecnCellSetParent (reg->recnCell, xaccSRGetParent (reg)); xaccRecnCellSetConfirmCB (reg->recnCell, recn_cell_confirm, reg);
/* enable callback for cursor user-driven moves */ /* enable callback for cursor user-driven moves */
table->move_cursor = LedgerMoveCursor; table->move_cursor = LedgerMoveCursor;

View File

@ -701,7 +701,7 @@ gnc_xfer_dialog_ok_cb(GtkWidget * widget, gpointer data)
(GTK_TOGGLE_BUTTON(xferData->amount_radio))) (GTK_TOGGLE_BUTTON(xferData->amount_radio)))
{ {
gnc_parse_error_dialog (xferData, gnc_parse_error_dialog (xferData,
_("You must enter a valie `to' amount.")); _("You must enter a valid `to' amount."));
return; return;
} }
} }

View File

@ -58,6 +58,7 @@
#include "gnc-http.h" #include "gnc-http.h"
#include "gnc-html-history.h" #include "gnc-html-history.h"
#include "gnc-network.h" #include "gnc-network.h"
#include "gnc-ui.h"
#include "query-user.h" #include "query-user.h"
#include "window-help.h" #include "window-help.h"
#include "window-main.h" #include "window-main.h"

View File

@ -224,8 +224,14 @@ gnc_main_window_open_report_url(const char * url, gint toplevel) {
GNOME_MDI_CHILD(reportchild)); GNOME_MDI_CHILD(reportchild));
} }
else { else {
GNCMainChildInfo * childwin;
gnome_mdi_add_view(GNOME_MDI(maininfo->mdi), gnome_mdi_add_view(GNOME_MDI(maininfo->mdi),
GNOME_MDI_CHILD(reportchild)); GNOME_MDI_CHILD(reportchild));
childwin = gtk_object_get_user_data(GTK_OBJECT(reportchild));
if (childwin && childwin->app && GTK_WIDGET (childwin->app)->window)
gdk_window_raise (GTK_WIDGET (childwin->app)->window);
} }
} }

View File

@ -41,8 +41,6 @@
#include "basiccell.h" #include "basiccell.h"
#include "gnc-engine-util.h" #include "gnc-engine-util.h"
#include "gnc-ui.h"
#include "messages.h"
#include "recncell.h" #include "recncell.h"
/* hack alert -- I am uncomfortable with including engine /* hack alert -- I am uncomfortable with including engine
@ -86,21 +84,9 @@ RecnEnter (BasicCell *_cell,
{ {
RecnCell *cell = (RecnCell *) _cell; RecnCell *cell = (RecnCell *) _cell;
/* throw up a popup if the user tries to undo a reconciled transaction if (cell->confirm_cb &&
hack alert -- this sets a new precedent. gnc_verify_dialog is defined ! (cell->confirm_cb (cell->reconciled_flag, cell->confirm_data)))
in both the motif and the gnome subdirs; I don't think I like it that return FALSE;
way. Now it's in ui-callbacks.h which is UI independent, but that's
still perhaps not optimal. */
if (cell->reconciled_flag == YREC)
{
const char *message = _("Do you really want to mark this transaction "
"not reconciled?\nDoing so might make future "
"reconciliation difficult!");
if (!gnc_verify_dialog_parented (cell->parent, message, TRUE))
return FALSE;
}
if (cell->reconciled_flag == NREC) if (cell->reconciled_flag == NREC)
cell->reconciled_flag = CREC; cell->reconciled_flag = CREC;
@ -120,6 +106,7 @@ xaccInitRecnCell (RecnCell *cell)
xaccInitBasicCell (&cell->cell); xaccInitBasicCell (&cell->cell);
xaccRecnCellSetFlag (cell, NREC); xaccRecnCellSetFlag (cell, NREC);
cell->confirm_cb = NULL;
cell->cell.enter_cell = RecnEnter; cell->cell.enter_cell = RecnEnter;
cell->cell.set_value = RecnSetValue; cell->cell.set_value = RecnSetValue;
@ -219,11 +206,13 @@ xaccRecnCellSetStringGetter (RecnCellStringGetter getter)
/* ================================================ */ /* ================================================ */
void void
xaccRecnCellSetParent (RecnCell *cell, gncUIWidget parent) xaccRecnCellSetConfirmCB (RecnCell *cell, RecnCellConfirm confirm_cb,
gpointer data)
{ {
g_return_if_fail (cell != NULL); g_return_if_fail (cell != NULL);
cell->parent = parent; cell->confirm_cb = confirm_cb;
cell->confirm_data = data;
} }
/* --------------- end of file ---------------------- */ /* --------------- end of file ---------------------- */

View File

@ -40,17 +40,21 @@
#ifndef __RECN_CELL_C__ #ifndef __RECN_CELL_C__
#define __RECN_CELL_C__ #define __RECN_CELL_C__
#include "basiccell.h" #include <glib.h>
#include "gnc-ui.h"
typedef const char * (*RecnCellStringGetter)(char); #include "basiccell.h"
typedef const char * (*RecnCellStringGetter) (char flag);
typedef gboolean (*RecnCellConfirm) (char old_flag, gpointer data);
typedef struct _RecnCell typedef struct _RecnCell
{ {
BasicCell cell; BasicCell cell;
char reconciled_flag; /* The actual flag value */ char reconciled_flag; /* The actual flag value */
gncUIWidget parent;
RecnCellConfirm confirm_cb;
gpointer confirm_data;
} RecnCell; } RecnCell;
RecnCell * xaccMallocRecnCell (void); RecnCell * xaccMallocRecnCell (void);
@ -59,7 +63,9 @@ void xaccDestroyRecnCell (RecnCell *cell);
void xaccRecnCellSetFlag (RecnCell *cell, char reconciled_flag); void xaccRecnCellSetFlag (RecnCell *cell, char reconciled_flag);
char xaccRecnCellGetFlag (RecnCell *cell); char xaccRecnCellGetFlag (RecnCell *cell);
void xaccRecnCellSetParent (RecnCell *cell, gncUIWidget parent); void xaccRecnCellSetConfirmCB (RecnCell *cell,
RecnCellConfirm confirm_cb,
gpointer data);
void xaccRecnCellSetStringGetter (RecnCellStringGetter getter); void xaccRecnCellSetStringGetter (RecnCellStringGetter getter);