mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
2002-10-26 Joshua Sled <jsled@asynchronous.org>
* src/gnome/dialog-sxsincelast.c (sxsincelast_tc_row_sel): Place the template transaction associated with the SX in the window, fixing Bug#93900. * src/gnome/dialog-sxsincelast.c (sxsincelast_populate): Process the auto-create transactions if there are only auto-create, no-notify SXes as a result of the since-last-run-dialog invocation; fixes bug #96944. * src/gnome/dialog-sxsincelast.c (sxsincelast_populate): Changed return-value from sxsincelast_populate to reflect all the possible conditions, allowing... * src/gnome/window-main.c (gnc_main_window_sched_xaction_slr_cb): Changed since-last-run-dialog-create return-value handling; fixes Bug#90060. * src/gnome/dialog-sxsincelast.c (add_to_create_list_to_gui): Setup of to-create page more correct; the first item which needs interaction is selected, or the widgets are set to inactive. Fixes Bug#96669 and Bug#96665. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@7394 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
a791960784
commit
3e900c3139
24
ChangeLog
24
ChangeLog
@ -1,3 +1,27 @@
|
|||||||
|
2002-10-26 Joshua Sled <jsled@asynchronous.org>
|
||||||
|
|
||||||
|
* src/gnome/dialog-sxsincelast.c (sxsincelast_tc_row_sel): Place
|
||||||
|
the template transaction associated with the SX in the window,
|
||||||
|
fixing Bug#93900.
|
||||||
|
|
||||||
|
* src/gnome/dialog-sxsincelast.c (sxsincelast_populate): Process
|
||||||
|
the auto-create transactions if there are only auto-create,
|
||||||
|
no-notify SXes as a result of the since-last-run-dialog
|
||||||
|
invocation; fixes bug #96944.
|
||||||
|
|
||||||
|
* src/gnome/dialog-sxsincelast.c (sxsincelast_populate): Changed
|
||||||
|
return-value from sxsincelast_populate to reflect all the possible
|
||||||
|
conditions, allowing...
|
||||||
|
|
||||||
|
* src/gnome/window-main.c (gnc_main_window_sched_xaction_slr_cb):
|
||||||
|
Changed since-last-run-dialog-create return-value handling; fixes
|
||||||
|
Bug#90060.
|
||||||
|
|
||||||
|
* src/gnome/dialog-sxsincelast.c (add_to_create_list_to_gui):
|
||||||
|
Setup of to-create page more correct; the first item which needs
|
||||||
|
interaction is selected, or the widgets are set to inactive.
|
||||||
|
Fixes Bug#96669 and Bug#96665.
|
||||||
|
|
||||||
2002-10-26 Christian Stimming <stimming@tuhh.de>
|
2002-10-26 Christian Stimming <stimming@tuhh.de>
|
||||||
|
|
||||||
* src/import-export/hbci/gnc-hbci-kvp.h,
|
* src/import-export/hbci/gnc-hbci-kvp.h,
|
||||||
|
@ -49,6 +49,7 @@
|
|||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
|
#include <limits.h>
|
||||||
#include <gnome.h>
|
#include <gnome.h>
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
|
|
||||||
@ -110,6 +111,7 @@
|
|||||||
#define CANCEL_BUTTON "cancel_button"
|
#define CANCEL_BUTTON "cancel_button"
|
||||||
#define VARIABLE_TABLE "variables_table"
|
#define VARIABLE_TABLE "variables_table"
|
||||||
#define AUTO_CREATE_VBOX "ac_vbox"
|
#define AUTO_CREATE_VBOX "ac_vbox"
|
||||||
|
#define TO_CREATE_TXN_REG_FRAME "to_create_txn_reg_frame"
|
||||||
#define CREATED_VBOX "created_vbox"
|
#define CREATED_VBOX "created_vbox"
|
||||||
#define WHAT_TO_DO_VBOX "what_to_do_vbox"
|
#define WHAT_TO_DO_VBOX "what_to_do_vbox"
|
||||||
#define WHAT_TO_DO_PROGRESS "creation_progress"
|
#define WHAT_TO_DO_PROGRESS "creation_progress"
|
||||||
@ -247,6 +249,8 @@ typedef struct _sxSinceLastData {
|
|||||||
GladeXML *gxml;
|
GladeXML *gxml;
|
||||||
|
|
||||||
GtkProgressBar *prog;
|
GtkProgressBar *prog;
|
||||||
|
GtkStatusbar *toCreateFormula;
|
||||||
|
guint formulaCtxId;
|
||||||
GtkStatusbar *toCreateStatus;
|
GtkStatusbar *toCreateStatus;
|
||||||
guint statusCtxId;
|
guint statusCtxId;
|
||||||
|
|
||||||
@ -279,15 +283,19 @@ typedef struct _sxSinceLastData {
|
|||||||
GNCLedgerDisplay *created_ledger;
|
GNCLedgerDisplay *created_ledger;
|
||||||
GNCRegWidget *created_regWidget;
|
GNCRegWidget *created_regWidget;
|
||||||
|
|
||||||
|
GNCLedgerDisplay *to_create_ledger;
|
||||||
|
GNCRegWidget *to_create_regWidget;
|
||||||
|
|
||||||
} sxSinceLastData;
|
} sxSinceLastData;
|
||||||
|
|
||||||
static void sxsincelast_init( sxSinceLastData *sxsld );
|
static void sxsincelast_init( sxSinceLastData *sxsld );
|
||||||
static void create_autoCreate_ledger( sxSinceLastData *sxsld );
|
static void create_autoCreate_ledger( sxSinceLastData *sxsld );
|
||||||
static void create_created_ledger( sxSinceLastData *sxsld );
|
static void create_created_ledger( sxSinceLastData *sxsld );
|
||||||
|
static void create_to_create_ledger( sxSinceLastData *sxsld );
|
||||||
static gncUIWidget sxsld_ledger_get_parent( GNCLedgerDisplay *ld );
|
static gncUIWidget sxsld_ledger_get_parent( GNCLedgerDisplay *ld );
|
||||||
static void gnc_sxsld_commit_ledgers( sxSinceLastData *sxsld );
|
static void gnc_sxsld_commit_ledgers( sxSinceLastData *sxsld );
|
||||||
|
|
||||||
static gboolean sxsincelast_populate( sxSinceLastData *sxsld );
|
static gint sxsincelast_populate( sxSinceLastData *sxsld );
|
||||||
static void sxsincelast_druid_cancelled( GnomeDruid *druid, gpointer ud );
|
static void sxsincelast_druid_cancelled( GnomeDruid *druid, gpointer ud );
|
||||||
static void sxsincelast_close_handler( gpointer ud );
|
static void sxsincelast_close_handler( gpointer ud );
|
||||||
|
|
||||||
@ -377,10 +385,18 @@ static gint sxsld_get_future_created_txn_count( sxSinceLastData *sxsld );
|
|||||||
/**
|
/**
|
||||||
* Used to wrap for the book-open hook, where the book filename is given.
|
* Used to wrap for the book-open hook, where the book filename is given.
|
||||||
**/
|
**/
|
||||||
gboolean
|
void
|
||||||
gnc_ui_sxsincelast_guile_wrapper( char *bookfile )
|
gnc_ui_sxsincelast_guile_wrapper( char *bookfile )
|
||||||
{
|
{
|
||||||
return gnc_ui_sxsincelast_dialog_create();
|
const char *no_dialog_but_created_msg =
|
||||||
|
_( "There are no Scheduled Transactions to be entered at this time.\n"
|
||||||
|
"(%d %s automatically created)" );
|
||||||
|
gint ret;
|
||||||
|
ret = gnc_ui_sxsincelast_dialog_create();
|
||||||
|
if ( ret < 0 ) {
|
||||||
|
gnc_info_dialog( no_dialog_but_created_msg,
|
||||||
|
-(ret), -(ret) == 1 ? _("transaction") : _("transactions") );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
@ -396,21 +412,28 @@ show_handler (const char *class, gint component_id,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns TRUE if the dialogs were created, FALSE if not. The caller
|
* @return The magnitude of the return value is the number of auto-created,
|
||||||
* probably wants to use this to inform the user in the manner appropriate to
|
* no-notification scheduled transactions created. This value is positive if
|
||||||
* the calling context.
|
* there are additionally other SXes which need user interaction and the
|
||||||
|
* Druid has been displayed, or negative if there are not, and no Druid
|
||||||
|
* window was realized. In the case where there the dialog has been
|
||||||
|
* displayed but no auto-create-no-notify transactions have been created,
|
||||||
|
* INT_MAX [limits.h] is returned. 0 is treated as negative, with no
|
||||||
|
* transactions created and no dialog displayed. The caller can use this
|
||||||
|
* value as appropriate to inform the user.
|
||||||
*
|
*
|
||||||
* [i.e., for book-open-hook: do nothing; for menu-selection: display an info
|
* [e.g., for book-open-hook: do nothing; for menu-selection: display an info
|
||||||
* dialog stating there's nothing to do.]
|
* dialog stating there's nothing to do.]
|
||||||
**/
|
**/
|
||||||
gboolean
|
gint
|
||||||
gnc_ui_sxsincelast_dialog_create()
|
gnc_ui_sxsincelast_dialog_create()
|
||||||
{
|
{
|
||||||
|
int autoCreateCount;
|
||||||
sxSinceLastData *sxsld;
|
sxSinceLastData *sxsld;
|
||||||
|
|
||||||
if (gnc_forall_gui_components (DIALOG_SXSINCELAST_CM_CLASS,
|
if (gnc_forall_gui_components (DIALOG_SXSINCELAST_CM_CLASS,
|
||||||
show_handler, NULL))
|
show_handler, NULL))
|
||||||
return TRUE;
|
return 0;
|
||||||
|
|
||||||
|
|
||||||
sxsld = g_new0( sxSinceLastData, 1 );
|
sxsld = g_new0( sxSinceLastData, 1 );
|
||||||
@ -418,9 +441,10 @@ gnc_ui_sxsincelast_dialog_create()
|
|||||||
sxsld->toCreateList = sxsld->reminderList = sxsld->toRemoveList = NULL;
|
sxsld->toCreateList = sxsld->reminderList = sxsld->toRemoveList = NULL;
|
||||||
sxsld->sxInitStates = g_hash_table_new( g_direct_hash, g_direct_equal );
|
sxsld->sxInitStates = g_hash_table_new( g_direct_hash, g_direct_equal );
|
||||||
|
|
||||||
if ( ! sxsincelast_populate( sxsld ) ) {
|
autoCreateCount = sxsincelast_populate( sxsld );
|
||||||
|
if ( autoCreateCount <= 0 ) {
|
||||||
g_free( sxsld );
|
g_free( sxsld );
|
||||||
return FALSE;
|
return autoCreateCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
sxsld->gxml = gnc_glade_xml_new( SX_GLADE_FILE,
|
sxsld->gxml = gnc_glade_xml_new( SX_GLADE_FILE,
|
||||||
@ -432,7 +456,7 @@ gnc_ui_sxsincelast_dialog_create()
|
|||||||
GNOME_DRUID( glade_xml_get_widget( sxsld->gxml,
|
GNOME_DRUID( glade_xml_get_widget( sxsld->gxml,
|
||||||
SXSLD_DRUID_GLADE_NAME ) );
|
SXSLD_DRUID_GLADE_NAME ) );
|
||||||
sxsincelast_init( sxsld );
|
sxsincelast_init( sxsld );
|
||||||
return TRUE;
|
return autoCreateCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -950,6 +974,9 @@ to_create_prep( GnomeDruidPage *druid_page,
|
|||||||
clean_variable_table( sxsld );
|
clean_variable_table( sxsld );
|
||||||
add_to_create_list_to_gui( sxsld->toCreateList, sxsld );
|
add_to_create_list_to_gui( sxsld->toCreateList, sxsld );
|
||||||
gtk_clist_thaw( GTK_CLIST(w) );
|
gtk_clist_thaw( GTK_CLIST(w) );
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
gnome_druid_set_buttons_sensitive(
|
gnome_druid_set_buttons_sensitive(
|
||||||
sxsld->sincelast_druid,
|
sxsld->sincelast_druid,
|
||||||
( gnc_sxsld_get_appropriate_page( sxsld,
|
( gnc_sxsld_get_appropriate_page( sxsld,
|
||||||
@ -1552,6 +1579,7 @@ sxsincelast_init( sxSinceLastData *sxsld )
|
|||||||
|
|
||||||
create_autoCreate_ledger( sxsld );
|
create_autoCreate_ledger( sxsld );
|
||||||
create_created_ledger( sxsld );
|
create_created_ledger( sxsld );
|
||||||
|
create_to_create_ledger( sxsld );
|
||||||
|
|
||||||
{
|
{
|
||||||
int width, height;
|
int width, height;
|
||||||
@ -1723,11 +1751,13 @@ add_to_create_list_to_gui( GList *toCreateList, sxSinceLastData *sxsld )
|
|||||||
toCreateInstance *tci;
|
toCreateInstance *tci;
|
||||||
GtkCTree *ct;
|
GtkCTree *ct;
|
||||||
GtkCTreeNode *sxNode;
|
GtkCTreeNode *sxNode;
|
||||||
|
GtkCTreeNode *firstToBeProcessedRow;
|
||||||
char *rowText[ TO_CREATE_LIST_WIDTH ];
|
char *rowText[ TO_CREATE_LIST_WIDTH ];
|
||||||
GList *insts;
|
GList *insts;
|
||||||
|
|
||||||
ct = GTK_CTREE( glade_xml_get_widget( sxsld->gxml, TO_CREATE_LIST ) );
|
ct = GTK_CTREE( glade_xml_get_widget( sxsld->gxml, TO_CREATE_LIST ) );
|
||||||
|
|
||||||
|
firstToBeProcessedRow = NULL;
|
||||||
for ( ; toCreateList ; toCreateList = toCreateList->next ) {
|
for ( ; toCreateList ; toCreateList = toCreateList->next ) {
|
||||||
tct = (toCreateTuple*)toCreateList->data;
|
tct = (toCreateTuple*)toCreateList->data;
|
||||||
|
|
||||||
@ -1782,13 +1812,21 @@ add_to_create_list_to_gui( GList *toCreateList, sxSinceLastData *sxsld )
|
|||||||
rowText,
|
rowText,
|
||||||
0, NULL, NULL, NULL, NULL,
|
0, NULL, NULL, NULL, NULL,
|
||||||
TRUE, FALSE );
|
TRUE, FALSE );
|
||||||
|
if ( !allVarsBound && !firstToBeProcessedRow ) {
|
||||||
|
firstToBeProcessedRow = tci->node;
|
||||||
|
}
|
||||||
gtk_ctree_node_set_row_data( ct, tci->node, tci );
|
gtk_ctree_node_set_row_data( ct, tci->node, tci );
|
||||||
g_free( rowText[0] );
|
g_free( rowText[0] );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* FIXME: Simulate a 'next' button press to get the right "first
|
/* Setup the first thing to be processed, or disable controls. */
|
||||||
* thing" hilighted */
|
if ( firstToBeProcessedRow ) {
|
||||||
|
gtk_ctree_select( ct, firstToBeProcessedRow );
|
||||||
|
sxsld_set_sensitive_tci_controls( sxsld, TRUE );
|
||||||
|
} else {
|
||||||
|
sxsld_set_sensitive_tci_controls( sxsld, FALSE );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static
|
static
|
||||||
@ -1991,31 +2029,28 @@ processSelectedReminderList( GList *goodList, sxSinceLastData *sxsld )
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns TRUE if there's some populated in the dialog to show to the user,
|
* @see gnc_ui_sxsincelast_dialog_create for the return value definition.
|
||||||
* FALSE if not.
|
|
||||||
**/
|
**/
|
||||||
static gboolean
|
static
|
||||||
|
gint
|
||||||
sxsincelast_populate( sxSinceLastData *sxsld )
|
sxsincelast_populate( sxSinceLastData *sxsld )
|
||||||
{
|
{
|
||||||
|
int toRet = 0;
|
||||||
|
gboolean onlyNoNotify = TRUE;
|
||||||
GList *sxList, *instanceList, *l, **containingList;
|
GList *sxList, *instanceList, *l, **containingList;
|
||||||
SchedXaction *sx;
|
SchedXaction *sx;
|
||||||
GDate end, endPlusReminders;
|
GDate end, endPlusReminders;
|
||||||
gint daysInAdvance;
|
gint daysInAdvance;
|
||||||
gboolean autocreateState, notifyState;
|
gboolean autocreateState, notifyState;
|
||||||
gboolean showIt;
|
|
||||||
toCreateTuple *tct;
|
toCreateTuple *tct;
|
||||||
toCreateInstance *tci;
|
toCreateInstance *tci;
|
||||||
|
|
||||||
showIt = FALSE;
|
|
||||||
|
|
||||||
instanceList = NULL;
|
instanceList = NULL;
|
||||||
|
|
||||||
sxList = gnc_book_get_schedxactions( gnc_get_current_book () );
|
sxList = gnc_book_get_schedxactions( gnc_get_current_book () );
|
||||||
|
|
||||||
if ( sxList == NULL ) {
|
if ( sxList == NULL ) {
|
||||||
DEBUG( "No scheduled transactions to populate." );
|
DEBUG( "No scheduled transactions to populate." );
|
||||||
return FALSE;
|
return toRet;
|
||||||
}
|
}
|
||||||
|
|
||||||
for ( ; sxList; sxList = sxList->next ) {
|
for ( ; sxList; sxList = sxList->next ) {
|
||||||
@ -2027,7 +2062,7 @@ sxsincelast_populate( sxSinceLastData *sxsld )
|
|||||||
PERR( "Why are we able to find a SX initial state "
|
PERR( "Why are we able to find a SX initial state "
|
||||||
"hash entry for something we're seeing for "
|
"hash entry for something we're seeing for "
|
||||||
"the first time?" );
|
"the first time?" );
|
||||||
return FALSE;
|
return toRet;
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
void *sx_state;
|
void *sx_state;
|
||||||
@ -2059,6 +2094,8 @@ sxsincelast_populate( sxSinceLastData *sxsld )
|
|||||||
postponed = gnc_sx_get_defer_instances( sx );
|
postponed = gnc_sx_get_defer_instances( sx );
|
||||||
|
|
||||||
for ( l = postponed; l; l = l->next ) {
|
for ( l = postponed; l; l = l->next ) {
|
||||||
|
onlyNoNotify = FALSE;
|
||||||
|
|
||||||
tci = g_new0( toCreateInstance, 1 );
|
tci = g_new0( toCreateInstance, 1 );
|
||||||
tci->sxStateData = (void*)l->data;
|
tci->sxStateData = (void*)l->data;
|
||||||
tci->date = g_date_new();
|
tci->date = g_date_new();
|
||||||
@ -2096,6 +2133,13 @@ sxsincelast_populate( sxSinceLastData *sxsld )
|
|||||||
tct = g_new0( toCreateTuple, 1 );
|
tct = g_new0( toCreateTuple, 1 );
|
||||||
tct->sx = sx;
|
tct->sx = sx;
|
||||||
for ( l = instanceList ; l; l = l->next ) {
|
for ( l = instanceList ; l; l = l->next ) {
|
||||||
|
|
||||||
|
/* only count the no-notify txns for this. */
|
||||||
|
if ( autocreateState && !notifyState ) {
|
||||||
|
onlyNoNotify &= (!notifyState);
|
||||||
|
toRet++;
|
||||||
|
}
|
||||||
|
|
||||||
tci = (toCreateInstance*)l->data;
|
tci = (toCreateInstance*)l->data;
|
||||||
tci->parentTCT = tct;
|
tci->parentTCT = tct;
|
||||||
|
|
||||||
@ -2108,16 +2152,32 @@ sxsincelast_populate( sxSinceLastData *sxsld )
|
|||||||
|
|
||||||
/* abstractly place the TCT onto the afore-determined list. */
|
/* abstractly place the TCT onto the afore-determined list. */
|
||||||
*containingList = g_list_append( *containingList, tct );
|
*containingList = g_list_append( *containingList, tct );
|
||||||
|
|
||||||
/* Report RE:showing the dialog iff there's stuff in it to
|
|
||||||
* show. */
|
|
||||||
showIt |= ( (g_list_length(sxsld->autoCreateList) > 0)
|
|
||||||
|| (g_list_length(sxsld->toCreateList) > 0) );
|
|
||||||
}
|
}
|
||||||
showIt |= ( g_list_length( sxsld->reminderList ) > 0
|
|
||||||
|| g_list_length( sxsld->toRemoveList ) > 0 );
|
|
||||||
|
|
||||||
return showIt;
|
/* Return appropriately. */
|
||||||
|
{
|
||||||
|
gboolean stuffToDo =
|
||||||
|
( g_list_length( sxsld->toRemoveList ) > 0
|
||||||
|
|| g_list_length( sxsld->reminderList ) > 0
|
||||||
|
|| g_list_length( sxsld->toCreateList ) > 0 );
|
||||||
|
if ( onlyNoNotify && !stuffToDo ) {
|
||||||
|
toRet = -(toRet);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( toRet == 0
|
||||||
|
&& ( stuffToDo
|
||||||
|
|| g_list_length( sxsld->autoCreateList ) > 0 ) ) {
|
||||||
|
toRet = INT_MAX;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* if we're about to return a negative value [indicating only
|
||||||
|
* auto-create no-notify txns], then actually create them. */
|
||||||
|
if ( toRet < 0 ) {
|
||||||
|
process_auto_create_list( sxsld->autoCreateList, sxsld );
|
||||||
|
}
|
||||||
|
|
||||||
|
return toRet;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -2728,16 +2788,14 @@ sxsincelast_tc_row_sel( GtkCTree *ct,
|
|||||||
toCreateInstance *tci;
|
toCreateInstance *tci;
|
||||||
sxSinceLastData *sxsld;
|
sxSinceLastData *sxsld;
|
||||||
|
|
||||||
|
|
||||||
/* FIXME: this should more gracefully deal with multiple 'row-select'
|
/* FIXME: this should more gracefully deal with multiple 'row-select'
|
||||||
* signals from double/triple-clicks. */
|
* signals from double/triple-clicks. */
|
||||||
sxsld = (sxSinceLastData*)user_data;
|
sxsld = (sxSinceLastData*)user_data;
|
||||||
|
|
||||||
tci = (toCreateInstance*)gtk_ctree_node_get_row_data( ct, node );
|
tci = (toCreateInstance*)gtk_ctree_node_get_row_data( ct, node );
|
||||||
if ( tci == NULL ) {
|
g_assert( tci );
|
||||||
PERR( "Given row-selection for row w/o "
|
|
||||||
"bound toCreateInstance." );
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
sxsld->curSelTCI = tci;
|
sxsld->curSelTCI = tci;
|
||||||
sxsld_set_sensitive_tci_controls( sxsld, TRUE );
|
sxsld_set_sensitive_tci_controls( sxsld, TRUE );
|
||||||
/* set real sensitivity based on the state of the TCI; when we change
|
/* set real sensitivity based on the state of the TCI; when we change
|
||||||
@ -2757,6 +2815,17 @@ sxsincelast_tc_row_sel( GtkCTree *ct,
|
|||||||
sxsld );
|
sxsld );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Setup the query for the to-create register to only show the
|
||||||
|
* transaction[s] associated with this lineitem. */
|
||||||
|
{
|
||||||
|
gchar *sxGUIDstr;
|
||||||
|
sxGUIDstr = guid_to_string( xaccSchedXactionGetGUID( tci->parentTCT->sx ) );
|
||||||
|
|
||||||
|
sxsld->to_create_ledger = gnc_ledger_display_template_gl( sxGUIDstr );
|
||||||
|
gnc_regWidget_set_ledger_display( sxsld->to_create_regWidget,
|
||||||
|
sxsld->to_create_ledger );
|
||||||
|
}
|
||||||
|
|
||||||
/* Get the count of variables; potentially remove the system-defined
|
/* Get the count of variables; potentially remove the system-defined
|
||||||
* variables if they're present in the expression. */
|
* variables if they're present in the expression. */
|
||||||
varHashSize = g_hash_table_size( tci->varBindings );
|
varHashSize = g_hash_table_size( tci->varBindings );
|
||||||
@ -3501,6 +3570,50 @@ create_created_ledger( sxSinceLastData *sxsld )
|
|||||||
gnc_ledger_display_refresh( sxsld->created_ledger );
|
gnc_ledger_display_refresh( sxsld->created_ledger );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
create_to_create_ledger( sxSinceLastData *sxsld )
|
||||||
|
{
|
||||||
|
SplitRegister *splitreg;
|
||||||
|
GtkWidget *txn_reg_frame;
|
||||||
|
Query *q;
|
||||||
|
|
||||||
|
q = xaccMallocQuery();
|
||||||
|
sxsld->to_create_ledger = gnc_ledger_display_query( q,
|
||||||
|
GENERAL_LEDGER,
|
||||||
|
REG_STYLE_LEDGER );
|
||||||
|
xaccFreeQuery( q );
|
||||||
|
gnc_ledger_display_set_handlers( sxsld->to_create_ledger,
|
||||||
|
NULL,
|
||||||
|
sxsld_ledger_get_parent );
|
||||||
|
gnc_ledger_display_set_user_data( sxsld->to_create_ledger, (gpointer)sxsld );
|
||||||
|
splitreg = gnc_ledger_display_get_split_register( sxsld->to_create_ledger );
|
||||||
|
/* FIXME: make configurable? */
|
||||||
|
gnucash_register_set_initial_rows( 4 );
|
||||||
|
|
||||||
|
sxsld->to_create_regWidget =
|
||||||
|
GNC_REGWIDGET(gnc_regWidget_new( sxsld->to_create_ledger,
|
||||||
|
GTK_WINDOW( sxsld->sincelast_window ),
|
||||||
|
CAP_SCHEDULE ));
|
||||||
|
|
||||||
|
txn_reg_frame = glade_xml_get_widget( sxsld->gxml, TO_CREATE_TXN_REG_FRAME );
|
||||||
|
gtk_container_add( GTK_CONTAINER( txn_reg_frame ),
|
||||||
|
GTK_WIDGET( sxsld->to_create_regWidget ) );
|
||||||
|
|
||||||
|
|
||||||
|
/* configure... */
|
||||||
|
/* don't use double-line */
|
||||||
|
/* FIXME */
|
||||||
|
gnc_split_register_config( splitreg,
|
||||||
|
splitreg->type, splitreg->style,
|
||||||
|
FALSE );
|
||||||
|
|
||||||
|
/* don't show present/future divider [by definition, not necessary] */
|
||||||
|
gnc_split_register_show_present_divider( splitreg, FALSE );
|
||||||
|
|
||||||
|
/* force a refresh */
|
||||||
|
gnc_ledger_display_refresh( sxsld->to_create_ledger );
|
||||||
|
}
|
||||||
|
|
||||||
static
|
static
|
||||||
gncUIWidget
|
gncUIWidget
|
||||||
sxsld_ledger_get_parent( GNCLedgerDisplay *ld )
|
sxsld_ledger_get_parent( GNCLedgerDisplay *ld )
|
||||||
|
@ -23,8 +23,22 @@
|
|||||||
#ifndef DIALOG_SXSINCELAST_H
|
#ifndef DIALOG_SXSINCELAST_H
|
||||||
#define DIALOG_SXSINCELAST_H
|
#define DIALOG_SXSINCELAST_H
|
||||||
|
|
||||||
gboolean gnc_ui_sxsincelast_dialog_create( void );
|
/**
|
||||||
gboolean gnc_ui_sxsincelast_guile_wrapper( char* );
|
* @return The magnitude of the return value is the number of auto-created,
|
||||||
|
* no-notification scheduled transactions created. This value is positive if
|
||||||
|
* there are additionally other SXes which need user interaction and the
|
||||||
|
* Druid has been displayed, or negative if there are not, and no Druid
|
||||||
|
* window was realized. In the case where there the dialog has been
|
||||||
|
* displayed but no auto-create-no-notify transactions have been created,
|
||||||
|
* INT_MAX [limits.h] is returned. 0 is treated as negative, with no
|
||||||
|
* transactions created and no dialog displayed. The caller can use this
|
||||||
|
* value as appropriate to inform the user.
|
||||||
|
*
|
||||||
|
* [e.g., for book-open-hook: do nothing; for menu-selection: display an info
|
||||||
|
* dialog stating there's nothing to do.]
|
||||||
|
**/
|
||||||
|
gint gnc_ui_sxsincelast_dialog_create( void );
|
||||||
|
void gnc_ui_sxsincelast_guile_wrapper( char* );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the varaibles from the Splits of the given SchedXaction as the
|
* Returns the varaibles from the Splits of the given SchedXaction as the
|
||||||
|
@ -4119,19 +4119,65 @@ Postpone
|
|||||||
</widget>
|
</widget>
|
||||||
|
|
||||||
<widget>
|
<widget>
|
||||||
<class>GtkStatusbar</class>
|
<class>GtkHBox</class>
|
||||||
<name>to_create_status</name>
|
<name>hbox175</name>
|
||||||
<border_width>5</border_width>
|
<homogeneous>False</homogeneous>
|
||||||
|
<spacing>0</spacing>
|
||||||
<child>
|
<child>
|
||||||
<padding>0</padding>
|
<padding>0</padding>
|
||||||
<expand>False</expand>
|
<expand>False</expand>
|
||||||
<fill>False</fill>
|
<fill>False</fill>
|
||||||
</child>
|
</child>
|
||||||
|
|
||||||
|
<widget>
|
||||||
|
<class>GtkLabel</class>
|
||||||
|
<name>label847967</name>
|
||||||
|
<label>Value:</label>
|
||||||
|
<justify>GTK_JUSTIFY_CENTER</justify>
|
||||||
|
<wrap>False</wrap>
|
||||||
|
<xalign>0.5</xalign>
|
||||||
|
<yalign>0.5</yalign>
|
||||||
|
<xpad>3</xpad>
|
||||||
|
<ypad>3</ypad>
|
||||||
|
<child>
|
||||||
|
<padding>0</padding>
|
||||||
|
<expand>False</expand>
|
||||||
|
<fill>False</fill>
|
||||||
|
</child>
|
||||||
|
</widget>
|
||||||
|
|
||||||
|
<widget>
|
||||||
|
<class>GtkStatusbar</class>
|
||||||
|
<name>to_create_status</name>
|
||||||
|
<border_width>3</border_width>
|
||||||
|
<child>
|
||||||
|
<padding>0</padding>
|
||||||
|
<expand>True</expand>
|
||||||
|
<fill>True</fill>
|
||||||
|
</child>
|
||||||
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
|
|
||||||
|
<widget>
|
||||||
|
<class>GtkFrame</class>
|
||||||
|
<name>to_create_txn_reg_frame</name>
|
||||||
|
<label>Transaction</label>
|
||||||
|
<label_xalign>0.05</label_xalign>
|
||||||
|
<shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type>
|
||||||
|
<child>
|
||||||
|
<padding>0</padding>
|
||||||
|
<expand>True</expand>
|
||||||
|
<fill>True</fill>
|
||||||
|
</child>
|
||||||
|
|
||||||
|
<widget>
|
||||||
|
<class>Placeholder</class>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
|
|
||||||
|
@ -248,16 +248,9 @@ by the user closing the window.")
|
|||||||
"gnc_ui_scheduled_xaction_dialog_create" '()
|
"gnc_ui_scheduled_xaction_dialog_create" '()
|
||||||
"Open the Scheduled Transaction Editor" )
|
"Open the Scheduled Transaction Editor" )
|
||||||
|
|
||||||
(gw:wrap-function
|
|
||||||
ws
|
|
||||||
'gnc:sx-sincelast-create
|
|
||||||
'<gw:bool>
|
|
||||||
"gnc_ui_sxsincelast_dialog_create" '()
|
|
||||||
"Wrapper to open the since-last-run dialog from a book-open hook." )
|
|
||||||
|
|
||||||
(gw:wrap-function
|
(gw:wrap-function
|
||||||
ws
|
ws
|
||||||
'gnc:sx-since-last-run-wrapper
|
'gnc:sx-since-last-run-wrapper
|
||||||
'<gw:bool>
|
'<gw:void>
|
||||||
"gnc_ui_sxsincelast_guile_wrapper" '(((<gw:mchars> caller-owned) bookfile))
|
"gnc_ui_sxsincelast_guile_wrapper" '(((<gw:mchars> caller-owned) bookfile))
|
||||||
"Wrapper to open the since-last-run dialog from a book-open hook." ))
|
"Wrapper to open the since-last-run dialog from a book-open hook." ))
|
||||||
|
@ -651,13 +651,26 @@ gnc_main_window_sched_xaction_cb (GtkWidget *widget, gpointer data)
|
|||||||
gnc_ui_scheduled_xaction_dialog_create();
|
gnc_ui_scheduled_xaction_dialog_create();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static
|
||||||
gnc_main_window_sched_xaction_slr_cb (GtkWidget *widget, gpointer data) {
|
void
|
||||||
|
gnc_main_window_sched_xaction_slr_cb (GtkWidget *widget, gpointer data)
|
||||||
|
{
|
||||||
|
gint ret;
|
||||||
|
|
||||||
const char *nothing_to_do_msg =
|
const char *nothing_to_do_msg =
|
||||||
_( "There are no Scheduled Transactions to deal with." );
|
_( "There are no Scheduled Transactions to be entered at this time." );
|
||||||
if ( ! gnc_ui_sxsincelast_dialog_create() ) {
|
const char *no_dialog_but_created_msg =
|
||||||
|
_( "There are no Scheduled Transactions to be entered at this time.\n"
|
||||||
|
"(%d %s automatically created)" );
|
||||||
|
|
||||||
|
ret = gnc_ui_sxsincelast_dialog_create();
|
||||||
|
if ( ret == 0 ) {
|
||||||
gnc_info_dialog( nothing_to_do_msg );
|
gnc_info_dialog( nothing_to_do_msg );
|
||||||
}
|
} else if ( ret < 0 ) {
|
||||||
|
gnc_info_dialog( no_dialog_but_created_msg,
|
||||||
|
-(ret), -(ret) == 1 ? _("transaction") : _("transactions") );
|
||||||
|
} /* else { this else [>0 means dialog was created] intentionally left
|
||||||
|
* blank. } */
|
||||||
}
|
}
|
||||||
|
|
||||||
static
|
static
|
||||||
|
@ -124,6 +124,7 @@ struct _RegWindow
|
|||||||
sort_type_t sort_type;
|
sort_type_t sort_type;
|
||||||
|
|
||||||
RegDateWindow *date_window;
|
RegDateWindow *date_window;
|
||||||
|
/* pcd = "print check dialog" */
|
||||||
gpointer pcd;
|
gpointer pcd;
|
||||||
gboolean read_only;
|
gboolean read_only;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user