From ebfd67b5459f4bf1a9ded1d6383eb4142bf46495 Mon Sep 17 00:00:00 2001 From: Linas Vepstas Date: Mon, 18 Oct 1999 03:56:10 +0000 Subject: [PATCH] patches from Dave Peticolas Date: Sun, 17 Oct 1999 18:01:53 -0700 git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@1941 57a11ea4-9604-0410-9ed3-97b8803252fd --- src/FileDialog.c | 22 +++++++++++----------- src/FileDialog.h | 2 +- src/SplitLedger.c | 8 ++++---- src/register/recncell.c | 5 +++-- src/ui-callbacks.h | 13 +++++++------ 5 files changed, 26 insertions(+), 24 deletions(-) diff --git a/src/FileDialog.c b/src/FileDialog.c index ff41082e87..67691bee36 100644 --- a/src/FileDialog.c +++ b/src/FileDialog.c @@ -51,27 +51,27 @@ static AccountGroup *topgroup = NULL; /* the current top of the heriarchy */ break; \ case ERR_FILEIO_FILE_NOT_FOUND: \ sprintf (buf, FILE_NOT_FOUND_MSG, newfile); \ - errorBox (buf); \ + gnc_error_dialog (buf); \ uh_oh = 1; \ break; \ case ERR_FILEIO_FILE_EMPTY: \ sprintf (buf, FILE_EMPTY_MSG, newfile); \ - errorBox (buf); \ + gnc_error_dialog (buf); \ uh_oh = 1; \ break; \ case ERR_FILEIO_FILE_TOO_NEW: \ - errorBox ( FILE_TOO_NEW_MSG); \ + gnc_error_dialog ( FILE_TOO_NEW_MSG); \ uh_oh = 1; \ break; \ case ERR_FILEIO_FILE_TOO_OLD: \ - if (!verifyBox( FILE_TOO_OLD_MSG )) { \ + if (!gnc_verify_dialog( FILE_TOO_OLD_MSG, GNC_T )) { \ xaccFreeAccountGroup (newgrp); \ newgrp = NULL; \ uh_oh = 1; \ } \ break; \ case ERR_FILEIO_FILE_BAD_READ: \ - if (!verifyBox( FILE_BAD_READ_MSG )) { \ + if (!gnc_verify_dialog( FILE_BAD_READ_MSG, GNC_T )) { \ xaccFreeAccountGroup (newgrp); \ newgrp = NULL; \ uh_oh = 1; \ @@ -89,14 +89,14 @@ static AccountGroup *topgroup = NULL; /* the current top of the heriarchy */ if (ETXTBSY == norr) \ { \ sprintf (buf, FMB_LOCKED_MSG, newfile); \ - errorBox (buf); \ + gnc_error_dialog (buf); \ uh_oh = 1; \ } \ else \ if (norr) \ { \ sprintf (buf, FMB_INVALID_MSG, newfile); \ - errorBox (buf); \ + gnc_error_dialog (buf); \ uh_oh = 1; \ } \ } \ @@ -160,7 +160,7 @@ gncFileQuerySave (void) */ while ( xaccAccountGroupNotSaved (grp) ) { - if( verifyBox( FMB_SAVE_MSG) ) + if( gnc_verify_dialog( FMB_SAVE_MSG, GNC_T ) ) { gncFileSave (); } @@ -215,7 +215,7 @@ gncPostFileOpen (const char * filename) if (!newgrp && !io_error) { sprintf (buf, FILE_NOT_FOUND_MSG, newfile); - errorBox ( buf); + gnc_error_dialog ( buf); uh_oh = 1; } @@ -458,7 +458,7 @@ gncFileSaveAs (void) tmpmsg = alloca (strlen (FMB_EEXIST_MSG) + strlen (newfile)); sprintf (tmpmsg, FMB_EEXIST_MSG, newfile); /* if user says cancel, we should break out */ - if (! verifyBox ( tmpmsg)) return; + if (! gnc_verify_dialog (tmpmsg, GNC_F)) return; /* Whoa-ok. Blow away the previous file. * Do not disable logging ... we want to capture the @@ -523,7 +523,7 @@ gncGetCurrentGroup (void) /* ======================================================== */ Session * -main_window_get_session (void) +gncGetCurrentSession (void) { return (current_session); } diff --git a/src/FileDialog.h b/src/FileDialog.h index 8761ee0d0f..435129e5b7 100644 --- a/src/FileDialog.h +++ b/src/FileDialog.h @@ -132,6 +132,6 @@ void gncFileQuit (void); AccountGroup *gncGetCurrentGroup (void); -Session *main_window_get_session (void); +Session *gncGetCurrentSession (void); #endif /* __GNC_FILE_DIALOG_H__ */ diff --git a/src/SplitLedger.c b/src/SplitLedger.c index c4f186c3b3..04018d6cba 100644 --- a/src/SplitLedger.c +++ b/src/SplitLedger.c @@ -194,7 +194,7 @@ LedgerMoveCursor (Table *table, reg->user_hack = (void *) xaccSplitGetParent (oldsplit); } xaccRegisterRefresh (reg); - refreshMainWindow(); + gnc_refresh_main_window(); /* indicate what row we *should* have gone to */ *p_new_phys_row = table->current_cursor_phys_row; @@ -331,7 +331,7 @@ xaccSRRedrawRegEntry (SplitRegister *reg) * of the splits. */ xaccTransDisplayRefresh (trans); - refreshMainWindow(); + gnc_refresh_main_window(); } /* ======================================================== */ @@ -470,7 +470,7 @@ xaccSRSaveRegEntry (SplitRegister *reg) /* make sure any open windows of the old account get redrawn */ xaccAccountDisplayRefresh (old_acc); - refreshMainWindow(); + gnc_refresh_main_window(); } if (MOD_MXFRM & changed) { @@ -513,7 +513,7 @@ xaccSRSaveRegEntry (SplitRegister *reg) /* make sure any open windows of the old account get redrawn */ xaccAccountDisplayRefresh (old_acc); - refreshMainWindow(); + gnc_refresh_main_window(); } } diff --git a/src/register/recncell.c b/src/register/recncell.c index c42534fcf1..11ad3ca3f4 100644 --- a/src/register/recncell.c +++ b/src/register/recncell.c @@ -50,13 +50,14 @@ ToggleRecn (BasicCell *_cell, const char *cur_val) char buff[2]; /* throw up a popup if the user tries to undo a reconciled transcation - hack alert -- this sets a new precedent ... verifyBox is defined in + hack alert -- this sets a new precedent ... gnc_verify_dialog is defined in both the motif and the gtk subdirs; I don't think I like it that way. Now it's in ui-callbacks.h which is UI independent, but that's still perhaps not optimal... */ if(cur_val[0] == YREC) { - if(!verifyBox("Really change state of reconciled transaction?")) { + if(!gnc_verify_dialog("Really change state of reconciled transaction?", + GNC_T)) { return strdup(cur_val); } } diff --git a/src/ui-callbacks.h b/src/ui-callbacks.h index d21f6263e7..9db1a9df41 100644 --- a/src/ui-callbacks.h +++ b/src/ui-callbacks.h @@ -28,12 +28,13 @@ #include -void refreshMainWindow( void ); +void gnc_refresh_main_window( void ); -/* deprecated... replaced by queryBox in GNOME version */ -gncBoolean verifyBox(const char *text); -void errorBox( const char *message ); -void setBusyCursor( gncUIWidget w ); -void unsetBusyCursor( gncUIWidget w ); +gncBoolean gnc_verify_dialog( const char *message, + gncBoolean yes_is_default ); +void gnc_error_dialog( const char *message ); + +void gnc_set_busy_cursor( gncUIWidget w ); +void gnc_unset_busy_cursor( gncUIWidget w ); #endif