mirror of
https://github.com/Gnucash/gnucash.git
synced 2024-12-01 13:09:41 -06:00
Revise overall SX logging: define G_LOG_DOMAIN in a fine-grained manner, switch to g_mumble calls, cleanup some formatting.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@15543 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
524620bee0
commit
140db6d1d9
@ -41,7 +41,10 @@
|
||||
#include "gnc-ui-util.h"
|
||||
#include "qof.h"
|
||||
|
||||
static QofLogModule log_module = GNC_MOD_SX;
|
||||
#define LOG_MOD "gnc.app-util.sx"
|
||||
static QofLogModule log_module = LOG_MOD;
|
||||
#undef G_LOG_DOMAIN
|
||||
#define G_LOG_DOMAIN LOG_MOD
|
||||
|
||||
static GObjectClass *parent_class = NULL;
|
||||
|
||||
@ -671,7 +674,7 @@ _gnc_sx_instance_event_handler(QofEntity *ent, QofEventId event_type, gpointer u
|
||||
}
|
||||
else if (instances->include_disabled)
|
||||
{
|
||||
PWARN("Could not remove instances that do not exist in the model");
|
||||
g_warning("could not remove instances that do not exist in the model");
|
||||
}
|
||||
}
|
||||
else if (event_type & GNC_EVENT_ITEM_ADDED)
|
||||
@ -685,7 +688,7 @@ _gnc_sx_instance_event_handler(QofEntity *ent, QofEventId event_type, gpointer u
|
||||
g_signal_emit_by_name(instances, "added", (gpointer)sx);
|
||||
}
|
||||
}
|
||||
/* else { printf("unsupported event type [%d]\n", event_type); } */
|
||||
/* else { g_critical("unsupported event type [%d]\n", event_type); } */
|
||||
}
|
||||
}
|
||||
|
||||
@ -698,8 +701,7 @@ gnc_sx_instance_model_update_sx_instances(GncSxInstanceModel *model, SchedXactio
|
||||
link = g_list_find_custom(model->sx_instance_list, sx, (GCompareFunc)_gnc_sx_instance_find_by_sx);
|
||||
if (link == NULL)
|
||||
{
|
||||
// @fixme: log/error
|
||||
printf("couldn't find sx [%p]\n", sx);
|
||||
g_critical("couldn't find sx [%p]\n", sx);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -766,8 +768,7 @@ gnc_sx_instance_model_remove_sx_instances(GncSxInstanceModel *model, SchedXactio
|
||||
instance_link = g_list_find_custom(model->sx_instance_list, sx, (GCompareFunc)_gnc_sx_instance_find_by_sx);
|
||||
if (instance_link == NULL)
|
||||
{
|
||||
// @fixme: warn
|
||||
// printf("instance not found!\n");
|
||||
g_warning("instance not found!\n");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -918,7 +919,8 @@ create_each_transaction_helper(Transaction *template_txn, void *user_data)
|
||||
txn_splits = xaccTransGetSplitList(new_txn);
|
||||
if ((template_splits == NULL) || (txn_splits == NULL))
|
||||
{
|
||||
PERR("\tseen transaction w/o splits. :(");
|
||||
g_critical("transaction w/o splits for sx [%s]",
|
||||
xaccSchedXactionGetName(creation_data->instance->parent->sx));
|
||||
xaccTransDestroy(new_txn);
|
||||
xaccTransCommitEdit(new_txn);
|
||||
return FALSE;
|
||||
@ -1041,7 +1043,8 @@ create_each_transaction_helper(Transaction *template_txn, void *user_data)
|
||||
|
||||
if (err_flag)
|
||||
{
|
||||
PERR("Some error in new transaction creation...");
|
||||
g_critical("new transaction creation sx [%s]",
|
||||
xaccSchedXactionGetName(creation_data->instance->parent->sx));
|
||||
xaccTransDestroy(new_txn);
|
||||
xaccTransCommitEdit(new_txn);
|
||||
return FALSE;
|
||||
@ -1318,9 +1321,9 @@ gnc_sx_instance_model_summarize(GncSxInstanceModel *model, GncSxSummary *summary
|
||||
void
|
||||
gnc_sx_summary_print(GncSxSummary *summary)
|
||||
{
|
||||
printf("num_instances: %d\n", summary->num_instances);
|
||||
printf("num_to_create: %d\n", summary->num_to_create_instances);
|
||||
printf("num_auto_create_instances: %d\n", summary->num_auto_create_instances);
|
||||
printf("num_auto_create_no_notify_instances: %d\n", summary->num_auto_create_no_notify_instances);
|
||||
printf("need dialog? %s\n", summary->need_dialog ? "true" : "false");
|
||||
g_message("num_instances: %d", summary->num_instances);
|
||||
g_message("num_to_create: %d", summary->num_to_create_instances);
|
||||
g_message("num_auto_create_instances: %d", summary->num_auto_create_instances);
|
||||
g_message("num_auto_create_no_notify_instances: %d", summary->num_auto_create_no_notify_instances);
|
||||
g_message("need dialog? %s", summary->need_dialog ? "true" : "false");
|
||||
}
|
||||
|
@ -21,11 +21,11 @@ TODO
|
||||
----------
|
||||
|
||||
- meta
|
||||
- [x] move files around
|
||||
- [ ] GncSxListTreeModelAdapter: s/real/adapted/
|
||||
- [ ] generic tree model adapter setup code
|
||||
- [ ] move documentation into doxygen comments, here and in sources.
|
||||
- [ ] printf -> logging
|
||||
- [x] move files around
|
||||
- [x] printf -> logging
|
||||
|
||||
- core
|
||||
- [x] sx list -> qof collection
|
||||
|
@ -87,11 +87,14 @@
|
||||
|
||||
#include "FreqSpecP.h"
|
||||
|
||||
static QofLogModule log_module = GNC_MOD_SX;
|
||||
#define LOG_MOD "gnc.engine.freqspec"
|
||||
static QofLogModule log_module = LOG_MOD;
|
||||
#undef G_LOG_DOMAIN
|
||||
#define G_LOG_DOMAIN LOG_MOD
|
||||
|
||||
/*
|
||||
* FIXME: should be in a header file
|
||||
*/
|
||||
|
||||
#ifdef HAVE_LANGINFO_D_FMT
|
||||
# define GNC_D_FMT (nl_langinfo (D_FMT))
|
||||
#else
|
||||
@ -753,10 +756,10 @@ xaccFreqSpecGetFreqStr( FreqSpec *fs, GString *str )
|
||||
{
|
||||
FreqSpec *subFS;
|
||||
if ( g_list_length( fs->s.composites.subSpecs ) != 5 ) {
|
||||
PERR( "Invalid Daily[M-F] structure." );
|
||||
snprintf( freqStrBuf, MAX_FREQ_STR_SIZE,
|
||||
"Daily[M-F]: error" );
|
||||
return;
|
||||
g_critical("Invalid Daily[M-F] structure");
|
||||
snprintf( freqStrBuf, MAX_FREQ_STR_SIZE,
|
||||
"Daily[M-F]: error" );
|
||||
return;
|
||||
}
|
||||
/* We assume that all of the weekly FreqSpecs that make up
|
||||
the Daily[M-F] FreqSpec have the same interval. */
|
||||
@ -925,9 +928,9 @@ xaccFreqSpecGetFreqStr( FreqSpec *fs, GString *str )
|
||||
case UIFREQ_SEMI_YEARLY:
|
||||
if ( fs->s.monthly.interval_months != 6 ) {
|
||||
if ( (fs->s.monthly.interval_months % 6) != 0 ) {
|
||||
PERR( "ERROR: FreqSpec Semi-Yearly month-interval "
|
||||
"is not a multiple of 6 [%d]",
|
||||
fs->s.monthly.interval_months );
|
||||
g_critical( "FreqSpec Semi-Yearly month-interval "
|
||||
"is not a multiple of 6 [%d]",
|
||||
fs->s.monthly.interval_months );
|
||||
}
|
||||
snprintf( freqStrBuf, MAX_FREQ_STR_SIZE,
|
||||
/* %u is the number of intervals; %u
|
||||
@ -948,9 +951,9 @@ xaccFreqSpecGetFreqStr( FreqSpec *fs, GString *str )
|
||||
case UIFREQ_YEARLY:
|
||||
if ( fs->s.monthly.interval_months != 12 ) {
|
||||
if ( (fs->s.monthly.interval_months % 12) != 0 ) {
|
||||
PERR( "ERROR: \"Yearly\" FreqSpec month-interval "
|
||||
"is not a multiple of 12 [%d]",
|
||||
fs->s.monthly.interval_months );
|
||||
g_critical( "Yearly FreqSpec month-interval "
|
||||
"is not a multiple of 12 [%d]",
|
||||
fs->s.monthly.interval_months );
|
||||
}
|
||||
|
||||
snprintf( freqStrBuf, MAX_FREQ_STR_SIZE,
|
||||
@ -1096,18 +1099,15 @@ gnc_freq_spec_compare( FreqSpec *a, FreqSpec *b )
|
||||
b->s.monthly.day_of_month );
|
||||
break;
|
||||
case MONTH_RELATIVE:
|
||||
DEBUG( "MONTH-RELATIVE dates not supported." );
|
||||
g_assert( FALSE );
|
||||
g_error( "MONTH-RELATIVE dates not supported." );
|
||||
break;
|
||||
case COMPOSITE:
|
||||
/* We shouldn't see a composite after doing the
|
||||
* composite-reduction above. */
|
||||
DEBUG( "This code should not be reached." );
|
||||
g_assert( FALSE );
|
||||
g_error( "This code should not be reached." );
|
||||
break;
|
||||
default:
|
||||
DEBUG( "Unknown freqspec type %d", fta );
|
||||
g_assert( FALSE );
|
||||
g_error( "Unknown freqspec type %d", fta );
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
|
@ -93,8 +93,8 @@ gnc_book_set_template_group (QofBook *book, AccountGroup *templateGroup)
|
||||
|
||||
if (templateGroup && templateGroup->book != book)
|
||||
{
|
||||
PERR ("cannot mix and match books freely!");
|
||||
return;
|
||||
g_critical("cannot mix and match books freely!");
|
||||
return;
|
||||
}
|
||||
|
||||
col = qof_book_get_collection (book, GNC_ID_SXTG);
|
||||
|
@ -41,7 +41,10 @@
|
||||
#include "Transaction.h"
|
||||
#include "gnc-engine.h"
|
||||
|
||||
static QofLogModule log_module = GNC_MOD_SX;
|
||||
#define LOG_MOD "gnc.engine.sx"
|
||||
static QofLogModule log_module = LOG_MOD;
|
||||
#undef G_LOG_DOMAIN
|
||||
#define G_LOG_DOMAIN LOG_MOD
|
||||
|
||||
/* Local Prototypes *****/
|
||||
|
||||
@ -190,7 +193,7 @@ gnc_sx_begin_edit (SchedXaction *sx)
|
||||
|
||||
static void commit_err (QofInstance *inst, QofBackendError errcode)
|
||||
{
|
||||
PERR ("Failed to commit: %d", errcode);
|
||||
g_critical("Failed to commit: %d", errcode);
|
||||
}
|
||||
|
||||
static void commit_done(QofInstance *inst)
|
||||
@ -491,14 +494,14 @@ xaccSchedXactionGetNextInstance( SchedXaction *sx, void *stateData )
|
||||
if ( xaccSchedXactionHasEndDate( sx ) ) {
|
||||
GDate *end_date = xaccSchedXactionGetEndDate( sx );
|
||||
if ( g_date_compare( &next_occur, end_date ) > 0 ) {
|
||||
PINFO( "next_occur past end date" );
|
||||
g_debug("next_occur past end date");
|
||||
g_date_clear( &next_occur, 1 );
|
||||
}
|
||||
} else if ( xaccSchedXactionHasOccurDef( sx ) ) {
|
||||
if ( stateData ) {
|
||||
temporalStateData *tsd = (temporalStateData*)stateData;
|
||||
if ( tsd->num_occur_rem == 0 ) {
|
||||
PINFO( "no more occurances remain" );
|
||||
g_debug("no more occurances remain");
|
||||
g_date_clear( &next_occur, 1 );
|
||||
}
|
||||
} else {
|
||||
|
@ -55,6 +55,7 @@
|
||||
#define GNC_MOD_IO "gnc.io"
|
||||
#define GNC_MOD_BOOK "gnc.book-period"
|
||||
#define GNC_MOD_GUI "gnc.gui"
|
||||
#define GNC_MOD_GUI_SX "gnc.gui.sx"
|
||||
#define GNC_MOD_GUILE "gnc.guile"
|
||||
#define GNC_MOD_LEDGER "gnc.ledger"
|
||||
#define GNC_MOD_REGISTER "gnc.register"
|
||||
|
@ -52,7 +52,7 @@ test_once (void)
|
||||
"once off" );
|
||||
}
|
||||
}
|
||||
fprintf (stdout, " FreqSpec: Single test OK, continuing . . . \r");
|
||||
fprintf(stdout, " FreqSpec: Single test OK, continuing . . . \r");
|
||||
fflush(stdout);
|
||||
xaccFreqSpecFree(fs);
|
||||
}
|
||||
|
@ -92,13 +92,13 @@ static void test_querynew (void)
|
||||
int
|
||||
main (int argc, char **argv)
|
||||
{
|
||||
qof_init();
|
||||
if(cashobjects_register()) {
|
||||
test_query_core();
|
||||
test_class();
|
||||
test_querynew();
|
||||
}
|
||||
qof_close();
|
||||
print_test_results();
|
||||
return get_rv();
|
||||
qof_init();
|
||||
if(cashobjects_register()) {
|
||||
test_query_core();
|
||||
test_class();
|
||||
test_querynew();
|
||||
}
|
||||
qof_close();
|
||||
print_test_results();
|
||||
return get_rv();
|
||||
}
|
||||
|
@ -73,6 +73,8 @@ static const gchar* MONTH_THAT_COLOR = "SlateGray1";
|
||||
static const gchar* MARK_COLOR = "Yellow";
|
||||
|
||||
static QofLogModule log_module = GNC_MOD_SX;
|
||||
#undef G_LOG_DOMAIN
|
||||
#define G_LOG_DOMAIN "gnc.gui.dense-cal"
|
||||
|
||||
static void gnc_dense_cal_class_init(GncDenseCalClass *class);
|
||||
static void gnc_dense_cal_init(GncDenseCal *dcal);
|
||||
@ -280,8 +282,7 @@ gnc_dense_cal_init(GncDenseCal *dcal)
|
||||
MAX_COLORS, TRUE, TRUE,
|
||||
&colorAllocSuccess) > 0)
|
||||
{
|
||||
/* FIXME : handle [more] properly */
|
||||
PERR("Error allocating colors\n");
|
||||
g_error("error allocating colors");
|
||||
}
|
||||
|
||||
/* Deal with the various label sizes. */
|
||||
@ -574,7 +575,7 @@ gnc_dense_cal_size_request(GtkWidget *widget,
|
||||
GncDenseCal *dcal = GNC_DENSE_CAL(widget);
|
||||
if (!dcal->initialized)
|
||||
{
|
||||
PERR("Uninitialized size request\n");
|
||||
g_warning("Uninitialized size request\n");
|
||||
requisition->width = DENSE_CAL_DEFAULT_WIDTH;
|
||||
requisition->height = DENSE_CAL_DEFAULT_HEIGHT;
|
||||
return;
|
||||
@ -1411,30 +1412,21 @@ wheres_this(GncDenseCal *dcal, int x, int y)
|
||||
|
||||
if ((x < 0) || (y < 0))
|
||||
{
|
||||
/* DEBUG("x(%d) or y(%d) < 0", x, y); */
|
||||
return -1;
|
||||
}
|
||||
if ((x >= GTK_WIDGET(dcal)->allocation.width)
|
||||
|| (y >= GTK_WIDGET(dcal)->allocation.height))
|
||||
{
|
||||
/*DEBUG("x(%d) > allocation.width(%d) or y(%d) > allocation->height(%d)",
|
||||
x, y,
|
||||
GTK_WIDGET(dcal)->allocation.width,
|
||||
GTK_WIDGET(dcal)->allocation.height);*/
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* "outside of displayed table" check */
|
||||
if (x >= (num_cols(dcal) * (col_width(dcal) + COL_BORDER_SIZE)))
|
||||
{
|
||||
/*DEBUG("x(%d) > (col_width(%d) * num_cols(%d))",
|
||||
x, col_width(dcal), num_cols(dcal));*/
|
||||
return -1;
|
||||
}
|
||||
if (y >= col_height(dcal))
|
||||
{
|
||||
/*DEBUG("y(%d) > col_height(%d)",
|
||||
y, col_height(dcal));*/
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -1445,19 +1437,16 @@ wheres_this(GncDenseCal *dcal, int x, int y)
|
||||
x -= dcal->label_width;
|
||||
if (x < 0)
|
||||
{
|
||||
/* DEBUG("X is over the label.");*/
|
||||
return -1;
|
||||
}
|
||||
if (x >= day_width(dcal) * 7)
|
||||
{
|
||||
/*DEBUG("X is in the col_border space.");*/
|
||||
return -1;
|
||||
}
|
||||
|
||||
y -= dcal->dayLabelHeight;
|
||||
if (y < 0)
|
||||
{
|
||||
/*DEBUG("Y is over the label.");*/
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -1472,7 +1461,6 @@ wheres_this(GncDenseCal *dcal, int x, int y)
|
||||
{
|
||||
if (dayCol < 0)
|
||||
{
|
||||
/*DEBUG("Before the beginning of the first month.");*/
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@ -1485,8 +1473,6 @@ wheres_this(GncDenseCal *dcal, int x, int y)
|
||||
g_date_add_months(&ccd, (colNum+1) * dcal->monthsPerCol);
|
||||
if (g_date_get_julian(&d) >= g_date_get_julian(&ccd))
|
||||
{
|
||||
/*DEBUG("%d outside of column range [%d]",
|
||||
g_date_get_julian(&d), g_date_get_julian(&ccd));*/
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@ -1498,7 +1484,7 @@ wheres_this(GncDenseCal *dcal, int x, int y)
|
||||
if (g_date_get_julian(&d) >= g_date_get_julian(&startD))
|
||||
{
|
||||
/* we're past the end of the displayed calendar, thus -1 */
|
||||
DEBUG("%d >= %d", g_date_get_julian(&d), g_date_get_julian(&startD));
|
||||
g_debug("%d >= %d", g_date_get_julian(&d), g_date_get_julian(&startD));
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -1587,7 +1573,7 @@ static void
|
||||
gdc_model_added_cb(GncDenseCalModel *model, guint added_tag, gpointer user_data)
|
||||
{
|
||||
GncDenseCal *cal = GNC_DENSE_CAL(user_data);
|
||||
printf("gdc_model_added_cb update\n");
|
||||
g_debug("gdc_model_added_cb update\n");
|
||||
gdc_add_tag_markings(cal, added_tag);
|
||||
}
|
||||
|
||||
@ -1595,7 +1581,7 @@ static void
|
||||
gdc_model_update_cb(GncDenseCalModel *model, guint update_tag, gpointer user_data)
|
||||
{
|
||||
GncDenseCal *cal = GNC_DENSE_CAL(user_data);
|
||||
printf("gdc_model_update_cb update for tag [%d]\n", update_tag);
|
||||
g_debug("gdc_model_update_cb update for tag [%d]\n", update_tag);
|
||||
gdc_mark_remove(cal, update_tag);
|
||||
gdc_add_tag_markings(cal, update_tag);
|
||||
}
|
||||
@ -1604,7 +1590,7 @@ static void
|
||||
gdc_model_removing_cb(GncDenseCalModel *model, guint remove_tag, gpointer user_data)
|
||||
{
|
||||
GncDenseCal *cal = GNC_DENSE_CAL(user_data);
|
||||
printf("gdc_model_removing_cb update [%d]\n", remove_tag);
|
||||
g_debug("gdc_model_removing_cb update [%d]\n", remove_tag);
|
||||
gdc_mark_remove(cal, remove_tag);
|
||||
}
|
||||
|
||||
@ -1644,7 +1630,7 @@ gdc_mark_add(GncDenseCal *dcal,
|
||||
|
||||
if (size == 0)
|
||||
{
|
||||
PERR("0 size not allowed\n");
|
||||
g_error("0 size not allowed\n");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1657,7 +1643,7 @@ gdc_mark_add(GncDenseCal *dcal,
|
||||
newMark->info = g_strdup(info);
|
||||
newMark->tag = tag;
|
||||
newMark->ourMarks = NULL;
|
||||
printf("saving mark with tag [%d]\n", newMark->tag);
|
||||
g_debug("saving mark with tag [%d]\n", newMark->tag);
|
||||
|
||||
for (i=0; i<size; i++)
|
||||
{
|
||||
@ -1690,7 +1676,7 @@ gdc_mark_remove(GncDenseCal *dcal, guint mark_to_remove)
|
||||
/* Ignore non-realistic marks */
|
||||
if ((gint)mark_to_remove == -1)
|
||||
{
|
||||
DEBUG("mark_to_remove = -1");
|
||||
g_debug("mark_to_remove = -1");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1703,12 +1689,12 @@ gdc_mark_remove(GncDenseCal *dcal, guint mark_to_remove)
|
||||
}
|
||||
if (iter == NULL)
|
||||
{
|
||||
DEBUG("couldn't find tag [%d]", mark_to_remove);
|
||||
g_warning("couldn't find tag [%d]", mark_to_remove);
|
||||
return;
|
||||
}
|
||||
if (mark_data == NULL)
|
||||
{
|
||||
DEBUG("mark_data == null");
|
||||
g_debug("mark_data == null");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -38,7 +38,10 @@
|
||||
#include "gnc-frequency.h"
|
||||
#include "gnc-ui-util.h"
|
||||
|
||||
static QofLogModule log_module = GNC_MOD_SX;
|
||||
#define LOG_MOD "gnc.gui.frequency"
|
||||
static QofLogModule log_module = LOG_MOD;
|
||||
#undef G_LOG_DOMAIN
|
||||
#define G_LOG_DOMAIN LOG_MOD
|
||||
|
||||
/** Private Defs ********************/
|
||||
|
||||
@ -291,10 +294,9 @@ do_frequency_setup( GNCFrequency *gf, FreqSpec *fs, time_t *secs)
|
||||
struct tm stm;
|
||||
/* set the date */
|
||||
if ( xaccFreqSpecGetOnce( fs, &theDate ) < 0 ) {
|
||||
PERR( "Inappropriate FreqSpec type "
|
||||
"[gnc-frequency: %d vs. FreqSpec: %d]\n",
|
||||
uift, xaccFreqSpecGetUIType( fs ) );
|
||||
return;
|
||||
g_warning("Inappropriate FreqSpec type [gnc-frequency: %d vs. FreqSpec: %d]",
|
||||
uift, xaccFreqSpecGetUIType( fs ));
|
||||
return;
|
||||
}
|
||||
g_date_to_struct_tm( &theDate, &stm );
|
||||
gnc_date_edit_set_time( gf->startDate, mktime(&stm) );
|
||||
@ -305,10 +307,9 @@ do_frequency_setup( GNCFrequency *gf, FreqSpec *fs, time_t *secs)
|
||||
GtkWidget *o;
|
||||
int dailyMult = -1;
|
||||
if ( xaccFreqSpecGetDaily( fs, &dailyMult ) < 0 ) {
|
||||
PERR( "Inappropriate FreqSpec type "
|
||||
"[gnc-frequency: %d vs. FreqSpec: %d]\n",
|
||||
uift, xaccFreqSpecGetUIType( fs ) );
|
||||
return;
|
||||
g_warning("Inappropriate FreqSpec type [gnc-frequency: %d vs. FreqSpec: %d]",
|
||||
uift, xaccFreqSpecGetUIType( fs ) );
|
||||
return;
|
||||
}
|
||||
o = glade_xml_get_widget( gf->gxml, "daily_spin" );
|
||||
gtk_spin_button_set_value( GTK_SPIN_BUTTON( o ), dailyMult );
|
||||
@ -324,15 +325,14 @@ do_frequency_setup( GNCFrequency *gf, FreqSpec *fs, time_t *secs)
|
||||
/* set the mult */
|
||||
fsList = xaccFreqSpecCompositeGet( fs );
|
||||
if ( g_list_length( fsList ) != 5 ) {
|
||||
PERR( "Invalid Daily[M-F] FreqSpec" );
|
||||
return;
|
||||
g_warning("Invalid Daily[M-F] FreqSpec");
|
||||
return;
|
||||
}
|
||||
subFS = (FreqSpec*)fsList->data;
|
||||
if ( xaccFreqSpecGetWeekly( subFS, &weekMult, &dayOfWeek ) < 0 ) {
|
||||
PERR( "Inappropriate FreqSpec type "
|
||||
"[gnc-frequency: %d vs. FreqSpec: %d]\n",
|
||||
uift, xaccFreqSpecGetUIType( fs ) );
|
||||
return;
|
||||
g_warning("Inappropriate FreqSpec type [gnc-frequency: %d vs. FreqSpec: %d]",
|
||||
uift, xaccFreqSpecGetUIType( fs ) );
|
||||
return;
|
||||
}
|
||||
o = glade_xml_get_widget( gf->gxml, "dailymf_spin" );
|
||||
gtk_spin_button_set_value( GTK_SPIN_BUTTON(o), weekMult );
|
||||
@ -352,43 +352,39 @@ do_frequency_setup( GNCFrequency *gf, FreqSpec *fs, time_t *secs)
|
||||
subFS = (FreqSpec*)(list->data);
|
||||
if ( weeklyMult == -1 ) {
|
||||
if ( subFS == NULL ) {
|
||||
PERR( "subFS is null\n" );
|
||||
return;
|
||||
g_critical("subFS is null");
|
||||
return;
|
||||
}
|
||||
if ( xaccFreqSpecGetWeekly( subFS,
|
||||
&weeklyMult,
|
||||
&dayOfWeek ) < 0 ) {
|
||||
PERR( "Inappropriate FreqSpec type "
|
||||
"[gnc-frequency: %d, FreqSpec: %d]\n",
|
||||
uift, xaccFreqSpecGetUIType( fs ) );
|
||||
return;
|
||||
g_warning("Inappropriate FreqSpec type [gnc-frequency: %d, FreqSpec: %d]",
|
||||
uift, xaccFreqSpecGetUIType( fs ) );
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
int otherWeeklyMult = -1;
|
||||
|
||||
if ( subFS == NULL ) {
|
||||
PERR( "subFS is null\n" );
|
||||
return;
|
||||
g_critical("subFS is null");
|
||||
return;
|
||||
}
|
||||
if ( xaccFreqSpecGetWeekly( subFS,
|
||||
&otherWeeklyMult,
|
||||
&dayOfWeek ) < 0 ) {
|
||||
PERR( "Inappropriate FreqSpec type "
|
||||
"[gnc-frequency: %d, FreqSpec: %d]\n",
|
||||
uift, xaccFreqSpecGetUIType( fs ) );
|
||||
return;
|
||||
g_warning("Inappropriate FreqSpec type [gnc-frequency: %d, FreqSpec: %d]",
|
||||
uift, xaccFreqSpecGetUIType( fs ) );
|
||||
return;
|
||||
}
|
||||
if ( weeklyMult != otherWeeklyMult ) {
|
||||
PERR( "Inconsistent weekly FreqSpec "
|
||||
"multipliers seen "
|
||||
"[first: %d vs. other: %d]\n",
|
||||
weeklyMult, otherWeeklyMult );
|
||||
return;
|
||||
g_warning("Inconsistent weekly FreqSpec multipliers seen [first: %d vs. other: %d]",
|
||||
weeklyMult, otherWeeklyMult );
|
||||
return;
|
||||
}
|
||||
}
|
||||
if ( dayOfWeek > 6 ) {
|
||||
PERR( "dayOfWeek > 6 [%d]", dayOfWeek );
|
||||
return;
|
||||
g_warning( "dayOfWeek > 6 [%d]", dayOfWeek );
|
||||
return;
|
||||
}
|
||||
str = CHECKBOX_NAMES[dayOfWeek];
|
||||
o = glade_xml_get_widget( gf->gxml, str );
|
||||
@ -415,10 +411,9 @@ do_frequency_setup( GNCFrequency *gf, FreqSpec *fs, time_t *secs)
|
||||
subFS = (FreqSpec*)(g_list_nth( list, 0 )->data);
|
||||
if ( xaccFreqSpecGetMonthly( subFS, &monthlyMult,
|
||||
&firstDayOfMonth, &monthOffset ) < 0 ) {
|
||||
PERR( "Inappropriate FreqSpec type "
|
||||
"[gnc-frequency: %d, FreqSpec: %d]\n",
|
||||
uift, xaccFreqSpecGetUIType( fs ) );
|
||||
return;
|
||||
g_warning("Inappropriate FreqSpec type [gnc-frequency: %d, FreqSpec: %d]",
|
||||
uift, xaccFreqSpecGetUIType( fs ) );
|
||||
return;
|
||||
}
|
||||
gtk_spin_button_set_value( GTK_SPIN_BUTTON(o), monthlyMult );
|
||||
/* first date */
|
||||
@ -429,8 +424,8 @@ do_frequency_setup( GNCFrequency *gf, FreqSpec *fs, time_t *secs)
|
||||
o = glade_xml_get_widget( gf->gxml, "semimonthly_second" );
|
||||
if ( xaccFreqSpecGetMonthly( subFS, &monthlyMult,
|
||||
&secondDayOfMonth, &monthOffset ) < 0 ) {
|
||||
PERR( "Inappropriate FreqSpec type\n" );
|
||||
return;
|
||||
g_warning( "Inappropriate FreqSpec type" );
|
||||
return;
|
||||
}
|
||||
gtk_combo_box_set_active( GTK_COMBO_BOX(o), secondDayOfMonth-1 );
|
||||
}
|
||||
@ -442,10 +437,9 @@ do_frequency_setup( GNCFrequency *gf, FreqSpec *fs, time_t *secs)
|
||||
|
||||
if ( xaccFreqSpecGetMonthly( fs, &monthlyMult,
|
||||
&dayOfMonth, &monthOffset ) < 0 ) {
|
||||
PERR( "Inappropriate FreqSpec type "
|
||||
"[gnc-frequency: %d, FreqSpec: %d]\n",
|
||||
uift, xaccFreqSpecGetUIType( fs ) );
|
||||
return;
|
||||
g_warning("Inappropriate FreqSpec type [gnc-frequency: %d, FreqSpec: %d]",
|
||||
uift, xaccFreqSpecGetUIType( fs ) );
|
||||
return;
|
||||
}
|
||||
o = glade_xml_get_widget( gf->gxml, "monthly_spin" );
|
||||
gtk_spin_button_set_value( GTK_SPIN_BUTTON(o), monthlyMult );
|
||||
@ -460,14 +454,13 @@ do_frequency_setup( GNCFrequency *gf, FreqSpec *fs, time_t *secs)
|
||||
|
||||
if ( xaccFreqSpecGetMonthly( fs, &monthlyMult,
|
||||
&dayOfMonth, &monthOffset ) < 0 ) {
|
||||
PERR( "Inappropriate FreqSpec type "
|
||||
"[gnc-frequency: %d, FreqSpec: %d]\n",
|
||||
uift, xaccFreqSpecGetUIType( fs ) );
|
||||
return;
|
||||
g_warning("Inappropriate FreqSpec type [gnc-frequency: %d, FreqSpec: %d]",
|
||||
uift, xaccFreqSpecGetUIType( fs ) );
|
||||
return;
|
||||
}
|
||||
if ( monthlyMult != 3 ) {
|
||||
PERR( "monthly multiplier != 3 [=%d]", monthlyMult );
|
||||
return;
|
||||
g_warning("monthly multiplier != 3 [=%d]", monthlyMult);
|
||||
return;
|
||||
}
|
||||
year_range_menu_helper( glade_xml_get_widget( gf->gxml,
|
||||
"quarterly_day" ),
|
||||
@ -482,14 +475,13 @@ do_frequency_setup( GNCFrequency *gf, FreqSpec *fs, time_t *secs)
|
||||
|
||||
if ( xaccFreqSpecGetMonthly( fs, &monthlyMult,
|
||||
&dayOfMonth, &monthOffset ) < 0 ) {
|
||||
PERR( "Inappropriate FreqSpec type "
|
||||
"[gnc-frequency: %d, FreqSpec: %d]\n",
|
||||
uift, xaccFreqSpecGetUIType( fs ) );
|
||||
return;
|
||||
g_warning("Inappropriate FreqSpec type [gnc-frequency: %d, FreqSpec: %d]",
|
||||
uift, xaccFreqSpecGetUIType( fs ) );
|
||||
return;
|
||||
}
|
||||
if ( monthlyMult != 4 ) {
|
||||
PERR( "Month-multiplier != 4 [=%d]", monthlyMult );
|
||||
return;
|
||||
g_warning("Month-multiplier != 4 [=%d]", monthlyMult);
|
||||
return;
|
||||
}
|
||||
year_range_menu_helper( glade_xml_get_widget( gf->gxml,
|
||||
"triyearly_day" ),
|
||||
@ -504,14 +496,13 @@ do_frequency_setup( GNCFrequency *gf, FreqSpec *fs, time_t *secs)
|
||||
|
||||
if ( xaccFreqSpecGetMonthly( fs, &monthlyMult,
|
||||
&dayOfMonth, &monthOffset ) < 0 ) {
|
||||
PERR( "Inappropriate FreqSpec type "
|
||||
"[gnc-frequency: %d, FreqSpec: %d]\n",
|
||||
uift, xaccFreqSpecGetUIType( fs ) );
|
||||
return;
|
||||
g_warning("Inappropriate FreqSpec type [gnc-frequency: %d, FreqSpec: %d]",
|
||||
uift, xaccFreqSpecGetUIType( fs ) );
|
||||
return;
|
||||
}
|
||||
if ( monthlyMult != 6 ) {
|
||||
PERR( "month-mult != 6 [=%d]", monthlyMult );
|
||||
return;
|
||||
g_warning( "month-mult != 6 [=%d]", monthlyMult );
|
||||
return;
|
||||
}
|
||||
year_range_menu_helper( glade_xml_get_widget( gf->gxml,
|
||||
"semiyearly_day" ),
|
||||
@ -527,14 +518,13 @@ do_frequency_setup( GNCFrequency *gf, FreqSpec *fs, time_t *secs)
|
||||
|
||||
if ( xaccFreqSpecGetMonthly( fs, &monthlyMult,
|
||||
&dayOfMonth, &monthOffset ) < 0 ) {
|
||||
PERR( "Inappropriate FreqSpec type "
|
||||
"[gnc-frequency: %d, FreqSpec: %d]\n",
|
||||
uift, xaccFreqSpecGetUIType( fs ) );
|
||||
return;
|
||||
g_warning("Inappropriate FreqSpec type [gnc-frequency: %d, FreqSpec: %d]",
|
||||
uift, xaccFreqSpecGetUIType( fs ) );
|
||||
return;
|
||||
}
|
||||
if ( (monthlyMult % 12) != 0) {
|
||||
PERR( "monthly-mult %% 12 != 0 [=%d]", ( monthlyMult % 12 ) );
|
||||
return;
|
||||
g_warning( "monthly-mult %% 12 != 0 [=%d]", ( monthlyMult % 12 ) );
|
||||
return;
|
||||
}
|
||||
|
||||
/* set the mult */
|
||||
@ -548,9 +538,8 @@ do_frequency_setup( GNCFrequency *gf, FreqSpec *fs, time_t *secs)
|
||||
}
|
||||
break;
|
||||
default:
|
||||
PERR( "unknown ui freq type %d [%d, %s]\n",
|
||||
uift, __LINE__, __FILE__ );
|
||||
break;
|
||||
g_critical( "unknown ui freq type %d", uift);
|
||||
break;
|
||||
}
|
||||
|
||||
g_signal_emit_by_name( gf, "changed" );
|
||||
@ -801,7 +790,7 @@ gnc_frequency_save_state( GNCFrequency *gf, FreqSpec *fs, GDate *outDate )
|
||||
{
|
||||
gchar buf[128];
|
||||
g_date_strftime(buf, 127, "%c", &gd);
|
||||
printf("monthly date [%s]\n", buf);
|
||||
g_debug("monthly date [%s]\n", buf);
|
||||
}
|
||||
xaccFreqSpecSetMonthly( fs, &gd, tmpInt );
|
||||
xaccFreqSpecSetUIType( fs, uift );
|
||||
@ -826,9 +815,8 @@ gnc_frequency_save_state( GNCFrequency *gf, FreqSpec *fs, GDate *outDate )
|
||||
xaccFreqSpecSetUIType( fs, uift );
|
||||
break;
|
||||
default:
|
||||
PERR( "Unknown UIFreqType %d [%d, %s]\n",
|
||||
uift, __LINE__, __FILE__ );
|
||||
break;
|
||||
g_critical("Unknown UIFreqType %d", uift);
|
||||
break;
|
||||
}
|
||||
gnc_resume_gui_refresh();
|
||||
}
|
||||
@ -1179,8 +1167,8 @@ start_date_changed( GNCDateEdit *gde, gpointer d )
|
||||
tmpTm->tm_mday-1 );
|
||||
break;
|
||||
default:
|
||||
PERR( "unknown uift value %d\n", uift );
|
||||
break;
|
||||
g_critical("unknown uift value %d", uift);
|
||||
break;
|
||||
}
|
||||
g_signal_emit_by_name( gf, "changed" );
|
||||
}
|
||||
|
@ -25,6 +25,9 @@
|
||||
#include "gnc-sx-instance-dense-cal-adapter.h"
|
||||
#include "gnc-dense-cal.h"
|
||||
|
||||
#undef G_LOG_DOMAIN
|
||||
#define G_LOG_DOMAIN "gnc.gui.sx.adapter.sx-dense-cal"
|
||||
|
||||
static void gnc_sx_instance_dense_cal_adapter_dispose(GObject *obj);
|
||||
static void gnc_sx_instance_dense_cal_adapter_finalize(GObject *obj);
|
||||
|
||||
@ -81,7 +84,7 @@ static void
|
||||
gsidca_instances_added_cb(GncSxInstanceModel *model, SchedXaction *sx_added, gpointer user_data)
|
||||
{
|
||||
GncSxInstanceDenseCalAdapter *adapter = GNC_SX_INSTANCE_DENSE_CAL_ADAPTER(user_data);
|
||||
printf("instance added\n");
|
||||
g_debug("instance added\n");
|
||||
if (xaccSchedXactionGetEnabled(sx_added))
|
||||
{
|
||||
g_signal_emit_by_name(adapter, "added", GPOINTER_TO_UINT(sx_added));
|
||||
@ -93,7 +96,7 @@ gsidca_instances_updated_cb(GncSxInstanceModel *model, SchedXaction *sx_updated,
|
||||
{
|
||||
GncSxInstanceDenseCalAdapter *adapter = GNC_SX_INSTANCE_DENSE_CAL_ADAPTER(user_data);
|
||||
gnc_sx_instance_model_update_sx_instances(model, sx_updated);
|
||||
printf("instances updated\n");
|
||||
g_debug("instances updated\n");
|
||||
if (xaccSchedXactionGetEnabled(sx_updated))
|
||||
{
|
||||
g_signal_emit_by_name(adapter, "update", GPOINTER_TO_UINT((gpointer)sx_updated));
|
||||
@ -108,7 +111,7 @@ static void
|
||||
gsidca_instances_removing_cb(GncSxInstanceModel *model, SchedXaction *sx_to_be_removed, gpointer user_data)
|
||||
{
|
||||
GncSxInstanceDenseCalAdapter *adapter = GNC_SX_INSTANCE_DENSE_CAL_ADAPTER(user_data);
|
||||
printf("removing instance...\n");
|
||||
g_debug("removing instance...\n");
|
||||
g_signal_emit_by_name(adapter, "removing", GPOINTER_TO_UINT(sx_to_be_removed));
|
||||
gnc_sx_instance_model_remove_sx_instances(model, sx_to_be_removed);
|
||||
}
|
||||
|
@ -64,7 +64,10 @@
|
||||
#include <langinfo.h>
|
||||
#endif
|
||||
|
||||
static QofLogModule log_module = GNC_MOD_SX;
|
||||
#define LOG_MOD "gnc.gui.sx.editor"
|
||||
static QofLogModule log_module = LOG_MOD;
|
||||
#undef G_LOG_DOMAIN
|
||||
#define G_LOG_DOMAIN LOG_MOD
|
||||
|
||||
static gint _sx_engine_event_handler_id = -1;
|
||||
|
||||
@ -480,25 +483,23 @@ check_credit_debit_balance( gpointer key,
|
||||
*unbalanced |= !(gnc_numeric_zero_p(
|
||||
gnc_numeric_sub_fixed( tcds->debitSum,
|
||||
tcds->creditSum ) ));
|
||||
#if GNC_DEBUG
|
||||
|
||||
|
||||
if ( gnc_numeric_zero_p( gnc_numeric_sub_fixed( tcds->debitSum,
|
||||
tcds->creditSum ) ) ) {
|
||||
DEBUG( "%.8x | true [%s - %s = %s]",
|
||||
(unsigned int)key,
|
||||
gnc_numeric_to_string( tcds->debitSum ),
|
||||
gnc_numeric_to_string( tcds->creditSum ),
|
||||
gnc_numeric_to_string(gnc_numeric_sub_fixed( tcds->debitSum,
|
||||
tcds->creditSum )) );
|
||||
g_debug( "%.8x | true [%s - %s = %s]",
|
||||
(unsigned int)key,
|
||||
gnc_numeric_to_string( tcds->debitSum ),
|
||||
gnc_numeric_to_string( tcds->creditSum ),
|
||||
gnc_numeric_to_string(gnc_numeric_sub_fixed( tcds->debitSum,
|
||||
tcds->creditSum )) );
|
||||
} else {
|
||||
DEBUG( "%.8x | false [%s - %s = %s]",
|
||||
(unsigned int)key,
|
||||
gnc_numeric_to_string( tcds->debitSum ),
|
||||
gnc_numeric_to_string( tcds->creditSum ),
|
||||
gnc_numeric_to_string(gnc_numeric_sub_fixed( tcds->debitSum,
|
||||
tcds->creditSum )) );
|
||||
g_debug( "%.8x | false [%s - %s = %s]",
|
||||
(unsigned int)key,
|
||||
gnc_numeric_to_string( tcds->debitSum ),
|
||||
gnc_numeric_to_string( tcds->creditSum ),
|
||||
gnc_numeric_to_string(gnc_numeric_sub_fixed( tcds->debitSum,
|
||||
tcds->creditSum )) );
|
||||
}
|
||||
#endif /* GNC_DEBUG */
|
||||
}
|
||||
|
||||
/**
|
||||
@ -920,7 +921,7 @@ gnc_sxed_save_sx( GncSxEditorDialog *sxed )
|
||||
g_date_clear( &gdate, 1 );
|
||||
xaccSchedXactionSetEndDate( sxed->sx, &gdate );
|
||||
} else {
|
||||
PERR( "No valid end specified\n" );
|
||||
g_critical("no valid end specified\n");
|
||||
}
|
||||
}
|
||||
|
||||
@ -975,7 +976,7 @@ gnc_sxed_save_sx( GncSxEditorDialog *sxed )
|
||||
|
||||
str = g_string_new( "" );
|
||||
xaccFreqSpecGetFreqStr( fs, str );
|
||||
DEBUG( "fs: %s", str->str );
|
||||
g_debug("fs: %s", str->str);
|
||||
|
||||
/* now that we have it, set the start date */
|
||||
xaccSchedXactionSetStartDate( sxed->sx, &gdate );
|
||||
@ -1008,8 +1009,8 @@ advance_toggle( GtkButton *o, GncSxEditorDialog *sxed )
|
||||
spinName = (gchar*)g_object_get_data( G_OBJECT(o), "whichOneAmI" );
|
||||
spin = glade_xml_get_widget( sxed->gxml, spinName );
|
||||
if ( !spin ) {
|
||||
PERR( "Error getting widget with name \"%s\"", spinName );
|
||||
return;
|
||||
g_critical("Error getting widget with name \"%s\"", spinName);
|
||||
return;
|
||||
}
|
||||
gtk_widget_set_sensitive( spin,
|
||||
gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(o) ) );
|
||||
@ -1151,7 +1152,7 @@ gnc_ui_scheduled_xaction_editor_dialog_create(SchedXaction *sx,
|
||||
editor_component_sx_equality,
|
||||
sx );
|
||||
if ( dlgExists != NULL ) {
|
||||
DEBUG( "dialog already exists; using that one." );
|
||||
g_debug( "dialog already exists; using that one." );
|
||||
sxed = (GncSxEditorDialog*)dlgExists->data;
|
||||
gtk_window_present( GTK_WINDOW(sxed->dialog) );
|
||||
g_list_free( dlgExists );
|
||||
@ -1477,7 +1478,7 @@ endgroup_rb_toggled( GtkButton *b, gpointer d )
|
||||
set_endgroup_toggle_states( sxed, END_OCCUR );
|
||||
break;
|
||||
default:
|
||||
g_error( "Unknown id %d", id );
|
||||
g_critical( "Unknown id %d", id );
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -70,7 +70,10 @@
|
||||
|
||||
#define SXFTD_RESPONSE_ADVANCED 100 /* 'Advanced' button response code */
|
||||
|
||||
static QofLogModule log_module = GNC_MOD_SX;
|
||||
static QofLogModule log_module = GNC_MOD_GUI_SX;
|
||||
|
||||
#undef G_LOG_DOMAIN
|
||||
#define G_LOG_DOMAIN GNC_MOD_GUI_SX
|
||||
|
||||
static void sxftd_freq_combo_changed( GtkWidget *w, gpointer user_data );
|
||||
static void gnc_sx_trans_window_response_cb(GtkDialog *dialog, gint response, gpointer data);
|
||||
@ -326,9 +329,8 @@ sxftd_update_fs( SXFromTransInfo *sxfti, GDate *date, FreqSpec *fs )
|
||||
break;
|
||||
|
||||
default:
|
||||
PERR("Nonexistent frequency selected. This is a bug.");
|
||||
g_assert( FALSE );
|
||||
break;
|
||||
g_critical("nonexistent frequency selected");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -366,7 +368,7 @@ sxftd_init( SXFromTransInfo *sxfti )
|
||||
g_object_ref(G_OBJECT(sxfti->example_cal));
|
||||
gtk_object_sink(GTK_OBJECT(sxfti->example_cal));
|
||||
|
||||
g_assert( sxfti->example_cal );
|
||||
g_assert(sxfti->example_cal);
|
||||
gnc_dense_cal_set_num_months( sxfti->example_cal, SXFTD_EXCAL_NUM_MONTHS );
|
||||
gnc_dense_cal_set_months_per_col( sxfti->example_cal, SXFTD_EXCAL_MONTHS_PER_COL );
|
||||
gtk_container_add( GTK_CONTAINER(w), GTK_WIDGET(sxfti->example_cal) );
|
||||
@ -541,10 +543,12 @@ sxftd_ok_clicked(SXFromTransInfo *sxfti)
|
||||
guint sx_error = sxftd_compute_sx(sxfti);
|
||||
|
||||
if (sx_error != 0
|
||||
&& sx_error != SXFTD_ERRNO_UNBALANCED_XACTION) {
|
||||
PERR( "Error in sxftd_compute_sx after ok_clicked [%d]", sx_error );
|
||||
&& sx_error != SXFTD_ERRNO_UNBALANCED_XACTION)
|
||||
{
|
||||
g_critical("sxftd_compute_sx after ok_clicked [%d]", sx_error);
|
||||
}
|
||||
else {
|
||||
else
|
||||
{
|
||||
if ( sx_error == SXFTD_ERRNO_UNBALANCED_XACTION ) {
|
||||
gnc_error_dialog( gnc_ui_get_toplevel(),
|
||||
_( "The Scheduled Transaction is unbalanced. "
|
||||
@ -600,10 +604,10 @@ sxftd_advanced_clicked(SXFromTransInfo *sxfti)
|
||||
if ( sx_error != 0
|
||||
&& sx_error != SXFTD_ERRNO_UNBALANCED_XACTION )
|
||||
{
|
||||
// unbalanced-xaction is "okay", since this is also checked for by
|
||||
// the advanced editor.
|
||||
PWARN( "something bad happened in sxftd_compute_sx [%d]", sx_error );
|
||||
return;
|
||||
// unbalanced-xaction is "okay", since this is also checked for by
|
||||
// the advanced editor.
|
||||
g_warning("something bad happened in sxftd_compute_sx [%d]", sx_error);
|
||||
return;
|
||||
}
|
||||
gtk_widget_hide( sxfti->dialog );
|
||||
/* force a gui update. */
|
||||
@ -644,20 +648,20 @@ gnc_sx_trans_window_response_cb (GtkDialog *dialog,
|
||||
SXFromTransInfo *sxfti = (SXFromTransInfo *)data;
|
||||
|
||||
ENTER(" dialog %p, response %d, sx %p", dialog, response, sxfti);
|
||||
switch (response) {
|
||||
case GTK_RESPONSE_OK:
|
||||
DEBUG(" OK");
|
||||
sxftd_ok_clicked(sxfti);
|
||||
break;
|
||||
case SXFTD_RESPONSE_ADVANCED:
|
||||
DEBUG(" ADVANCED");
|
||||
sxftd_advanced_clicked(sxfti);
|
||||
break;
|
||||
case GTK_RESPONSE_CANCEL:
|
||||
default:
|
||||
DEBUG(" CANCEL");
|
||||
sxftd_close(sxfti, TRUE);
|
||||
break;
|
||||
switch (response) {
|
||||
case GTK_RESPONSE_OK:
|
||||
g_debug(" OK");
|
||||
sxftd_ok_clicked(sxfti);
|
||||
break;
|
||||
case SXFTD_RESPONSE_ADVANCED:
|
||||
g_debug(" ADVANCED");
|
||||
sxftd_advanced_clicked(sxfti);
|
||||
break;
|
||||
case GTK_RESPONSE_CANCEL:
|
||||
default:
|
||||
g_debug(" CANCEL");
|
||||
sxftd_close(sxfti, TRUE);
|
||||
break;
|
||||
|
||||
}
|
||||
LEAVE(" ");
|
||||
@ -708,7 +712,7 @@ sxftd_update_example_cal( SXFromTransInfo *sxfti )
|
||||
gnc_dense_cal_store_update_count_end(sxfti->dense_cal_model, &startDate, fs, get.n_occurrences);
|
||||
break;
|
||||
default:
|
||||
printf("unknown get.type [%d]\n", get.type);
|
||||
g_warning("unknown get.type [%d]\n", get.type);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -760,7 +764,7 @@ gnc_sx_create_from_trans( Transaction *trans )
|
||||
}
|
||||
else
|
||||
{
|
||||
PERR( "Error in sxftd_init: %d", errno );
|
||||
g_error("sxftd_init: %d", errno);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -40,7 +40,8 @@
|
||||
#include "gnc-gconf-utils.h"
|
||||
#include "gnc-gui-query.h"
|
||||
|
||||
// static QofLogModule log_module = GNC_MOD_GUI;
|
||||
#undef G_LOG_DOMAIN
|
||||
#define G_LOG_DOMAIN "gnc.gui.sx.slr"
|
||||
|
||||
#define GCONF_SECTION "dialogs/scheduled_trans/since_last_run"
|
||||
|
||||
@ -853,21 +854,21 @@ instance_state_changed_cb(GtkCellRendererText *cell,
|
||||
}
|
||||
if (i == SX_INSTANCE_STATE_CREATED)
|
||||
{
|
||||
printf("unknown value [%s]\n", value);
|
||||
g_warning("unknown value [%s]", value);
|
||||
return;
|
||||
}
|
||||
new_state = i;
|
||||
|
||||
if (!gtk_tree_model_get_iter_from_string(GTK_TREE_MODEL(dialog->editing_model), &tree_iter, path))
|
||||
{
|
||||
printf("unknown path [%s]\n", path);
|
||||
g_warning("unknown path [%s]", path);
|
||||
return;
|
||||
}
|
||||
|
||||
inst = gnc_sx_slr_model_get_instance(dialog->editing_model, &tree_iter);
|
||||
if (inst == NULL)
|
||||
{
|
||||
printf("invalid path [%s]\n", path);
|
||||
g_warning("invalid path [%s]", path);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -886,23 +887,23 @@ variable_value_changed_cb(GtkCellRendererText *cell,
|
||||
gnc_numeric parsed_num;
|
||||
char *endStr = NULL;
|
||||
|
||||
printf("variable to [%s] at path [%s]\n", value, path);
|
||||
g_debug("variable to [%s] at path [%s]", value, path);
|
||||
if (!gtk_tree_model_get_iter_from_string(GTK_TREE_MODEL(dialog->editing_model), &tree_iter, path))
|
||||
{
|
||||
printf("invalid path [%s]\n", path);
|
||||
g_warning("invalid path [%s]", path);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!gnc_sx_slr_model_get_instance_and_variable(dialog->editing_model, &tree_iter, &inst, &var))
|
||||
{
|
||||
printf("path [%s] doesn't correspond to a valid variable\n", path);
|
||||
g_critical("path [%s] doesn't correspond to a valid variable", path);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!xaccParseAmount(value, TRUE, &parsed_num, &endStr)
|
||||
|| gnc_numeric_check(parsed_num) != GNC_ERROR_OK)
|
||||
{
|
||||
printf("@@fixme: better parse error handling\n");
|
||||
g_critical("@@fixme: better parse error handling");
|
||||
// @fixme: set location (back) to "(need value)"
|
||||
return;
|
||||
}
|
||||
@ -1041,7 +1042,7 @@ dialog_response_cb(GtkDialog *dialog, gint response_id, GncSxSinceLastRunDialog
|
||||
{
|
||||
GList *unbound_variables;
|
||||
unbound_variables = gnc_sx_slr_model_check_variables(app_dialog->editing_model);
|
||||
printf("%d variables unbound\n", g_list_length(unbound_variables));
|
||||
g_message("%d variables unbound", g_list_length(unbound_variables));
|
||||
if (g_list_length(unbound_variables) > 0)
|
||||
{
|
||||
// focus first variable
|
||||
@ -1081,8 +1082,7 @@ dialog_response_cb(GtkDialog *dialog, gint response_id, GncSxSinceLastRunDialog
|
||||
app_dialog->editing_model = NULL;
|
||||
break;
|
||||
default:
|
||||
printf("unknown response id [%d]\n", response_id);
|
||||
g_assert_not_reached();
|
||||
g_error("unknown response id [%d]", response_id);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -57,7 +57,10 @@
|
||||
#include "dialog-sx-editor.h"
|
||||
|
||||
/* This static indicates the debugging module that this .o belongs to. */
|
||||
static QofLogModule log_module = GNC_MOD_GUI;
|
||||
static QofLogModule log_module = "gnc.gui.plugin-page";
|
||||
|
||||
#undef G_LOG_DOMAIN
|
||||
#define G_LOG_DOMAIN "gnc.gui.plugin-page.sx-list"
|
||||
|
||||
#define PLUGIN_PAGE_SX_LIST_CM_CLASS "plugin-page-sx-list"
|
||||
#define GCONF_SECTION "window/pages/sx_list"
|
||||
@ -180,7 +183,6 @@ gnc_plugin_page_sx_list_init (GncPluginPageSxList *plugin_page)
|
||||
GncPluginPageSxListPrivate *priv;
|
||||
GncPluginPage *parent;
|
||||
|
||||
ENTER("page %p", plugin_page);
|
||||
priv = GNC_PLUGIN_PAGE_SX_LIST_GET_PRIVATE(plugin_page);
|
||||
|
||||
/* Init parent declared variables */
|
||||
@ -203,9 +205,6 @@ gnc_plugin_page_sx_list_init (GncPluginPageSxList *plugin_page)
|
||||
gnc_plugin_page_sx_list_n_actions,
|
||||
plugin_page);
|
||||
/* gnc_plugin_init_short_names (action_group, toolbar_labels); */
|
||||
|
||||
LEAVE("page %p, priv %p, action group %p",
|
||||
plugin_page, priv, action_group);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -214,8 +213,6 @@ gnc_plugin_page_sx_list_dispose(GObject *object)
|
||||
GncPluginPageSxList *page;
|
||||
GncPluginPageSxListPrivate *priv;
|
||||
|
||||
ENTER("object %p", object);
|
||||
|
||||
page = GNC_PLUGIN_PAGE_SX_LIST (object);
|
||||
g_return_if_fail(GNC_IS_PLUGIN_PAGE_SX_LIST (page));
|
||||
priv = GNC_PLUGIN_PAGE_SX_LIST_GET_PRIVATE(page);
|
||||
@ -234,7 +231,6 @@ gnc_plugin_page_sx_list_dispose(GObject *object)
|
||||
priv->instances = NULL;
|
||||
|
||||
G_OBJECT_CLASS (parent_class)->dispose(object);
|
||||
LEAVE(" ");
|
||||
}
|
||||
|
||||
static void
|
||||
@ -243,8 +239,6 @@ gnc_plugin_page_sx_list_finalize (GObject *object)
|
||||
GncPluginPageSxList *page;
|
||||
GncPluginPageSxListPrivate *priv;
|
||||
|
||||
ENTER("object %p", object);
|
||||
|
||||
page = GNC_PLUGIN_PAGE_SX_LIST (object);
|
||||
g_return_if_fail(GNC_IS_PLUGIN_PAGE_SX_LIST (page));
|
||||
priv = GNC_PLUGIN_PAGE_SX_LIST_GET_PRIVATE(page);
|
||||
@ -254,7 +248,6 @@ gnc_plugin_page_sx_list_finalize (GObject *object)
|
||||
// data get freed somewhere else?
|
||||
|
||||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||
LEAVE(" ");
|
||||
}
|
||||
|
||||
/* Virtual Functions */
|
||||
@ -309,13 +302,10 @@ gnc_plugin_page_sx_list_create_widget (GncPluginPage *plugin_page)
|
||||
GncPluginPageSxList *page;
|
||||
GncPluginPageSxListPrivate *priv;
|
||||
|
||||
ENTER("page %p", plugin_page);
|
||||
page = GNC_PLUGIN_PAGE_SX_LIST(plugin_page);
|
||||
priv = GNC_PLUGIN_PAGE_SX_LIST_GET_PRIVATE(page);
|
||||
if (priv->widget != NULL) {
|
||||
LEAVE("widget = %p", priv->widget);
|
||||
if (priv->widget != NULL)
|
||||
return priv->widget;
|
||||
}
|
||||
|
||||
priv->gxml = gnc_glade_xml_new("sched-xact.glade", "sx-list-vbox");
|
||||
priv->widget = glade_xml_get_widget(priv->gxml, "sx-list-vbox");
|
||||
@ -418,7 +408,6 @@ gnc_plugin_page_sx_list_destroy_widget (GncPluginPage *plugin_page)
|
||||
GncPluginPageSxList *page;
|
||||
GncPluginPageSxListPrivate *priv;
|
||||
|
||||
ENTER("page %p", plugin_page);
|
||||
page = GNC_PLUGIN_PAGE_SX_LIST (plugin_page);
|
||||
priv = GNC_PLUGIN_PAGE_SX_LIST_GET_PRIVATE(page);
|
||||
|
||||
@ -431,8 +420,6 @@ gnc_plugin_page_sx_list_destroy_widget (GncPluginPage *plugin_page)
|
||||
gnc_unregister_gui_component(priv->gnc_component_id);
|
||||
priv->gnc_component_id = 0;
|
||||
}
|
||||
|
||||
LEAVE("widget destroyed");
|
||||
}
|
||||
|
||||
/**
|
||||
@ -455,9 +442,6 @@ gnc_plugin_page_sx_list_save_page (GncPluginPage *plugin_page,
|
||||
g_return_if_fail(key_file != NULL);
|
||||
g_return_if_fail(group_name != NULL);
|
||||
|
||||
ENTER("page %p, key_file %p, group_name %s", plugin_page, key_file,
|
||||
group_name);
|
||||
|
||||
page = GNC_PLUGIN_PAGE_SX_LIST(plugin_page);
|
||||
priv = GNC_PLUGIN_PAGE_SX_LIST_GET_PRIVATE(page);
|
||||
|
||||
@ -465,7 +449,6 @@ gnc_plugin_page_sx_list_save_page (GncPluginPage *plugin_page,
|
||||
gnc_tree_view_account_save(GNC_TREE_VIEW_ACCOUNT(priv->tree_view),
|
||||
&priv->fd, key_file, group_name);
|
||||
#endif /* 0 */
|
||||
LEAVE(" ");
|
||||
}
|
||||
|
||||
/**
|
||||
@ -486,7 +469,6 @@ gnc_plugin_page_sx_list_recreate_page (GtkWidget *window,
|
||||
|
||||
g_return_val_if_fail(key_file, NULL);
|
||||
g_return_val_if_fail(group_name, NULL);
|
||||
ENTER("key_file %p, group_name %s", key_file, group_name);
|
||||
|
||||
/* Create the new page. */
|
||||
page = GNC_PLUGIN_PAGE_SX_LIST(gnc_plugin_page_sx_list_new());
|
||||
@ -499,7 +481,6 @@ gnc_plugin_page_sx_list_recreate_page (GtkWidget *window,
|
||||
gnc_tree_view_account_restore(GNC_TREE_VIEW_ACCOUNT(priv->tree_view),
|
||||
&priv->fd, key_file, group_name);
|
||||
#endif /* 0 */
|
||||
LEAVE(" ");
|
||||
return GNC_PLUGIN_PAGE(page);
|
||||
}
|
||||
|
||||
@ -554,7 +535,7 @@ gnc_plugin_page_sx_list_cmd_edit(GtkAction *action, GncPluginPageSxList *page)
|
||||
selected_paths = gtk_tree_selection_get_selected_rows(selection, &model);
|
||||
if (g_list_length(selected_paths) == 0)
|
||||
{
|
||||
PERR("no selection edit.");
|
||||
g_warning("no selection edit.");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -604,7 +585,7 @@ gnc_plugin_page_sx_list_cmd_delete(GtkAction *action, GncPluginPageSxList *page)
|
||||
selected_paths = gtk_tree_selection_get_selected_rows(selection, &model);
|
||||
if (g_list_length(selected_paths) == 0)
|
||||
{
|
||||
PERR("no selection for delete.");
|
||||
g_warning("no selection for delete.");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -613,7 +594,7 @@ gnc_plugin_page_sx_list_cmd_delete(GtkAction *action, GncPluginPageSxList *page)
|
||||
GList *list;
|
||||
for (list = to_delete; list != NULL; list = list->next)
|
||||
{
|
||||
DEBUG("to-delete [%s]\n", xaccSchedXactionGetName((SchedXaction*)list->data));
|
||||
g_debug("to-delete [%s]\n", xaccSchedXactionGetName((SchedXaction*)list->data));
|
||||
}
|
||||
}
|
||||
g_list_foreach(to_delete, (GFunc)_destroy_sx, NULL);
|
||||
|
Loading…
Reference in New Issue
Block a user