Commit 7854d70c authored by Maxime Doyen's avatar Maxime Doyen

5.1.4 release

parent 87118c10
2017-02-16 Maxime Doyen
Made 5.1.4 release.
* change: filter, reworked the layout
* change: filter, category select change now propagate to subcategories
* wish : #1661806 show overdraft amount in account window (balance column)
* wish : #1655542 improve handling of end of month scheduled transactions
* bugfix: sanity was not checking dst_account
* bugfix: sanity orphaned account was not working
* bugfix: #1663795 "show all" shows as enabled after opening another file
* bugfix: #1663789 both sides of internal transfers' accounts not changed
* bugfix: #1663399 display Order of Account Types (5.1.3)
* bugfix: #1662197 main window's upcoming transactions pane shifts downwards on every startup
* bugfix: #1662189 main window size/position saved only when using wm close (X) button
* bugfix: #1661279 memory Fault on homebank-5.1.1-1.fc25.x86_64 and later
* bugfix: #1660910 main window layout is not persisted
* bugfix: #1658538 balance Report crash when no txn at all
* bugfix: #1656720 save button in main window disabled despite pending changes
* bugfix: #1655626 libofx for windows bad utf-8 char import corrupt xml file
2017-01-22 Maxime Doyen
Made 5.1.3 release.
......@@ -7,15 +28,15 @@
* wish : #1645126 remember the size of columns listview in the main window
* wish : #1530784 easy way to see closed accounts in account list
* wish : #1164643 totals per Financial Institution in account summary
* bugfix: #1658047 Euro major Lithuanian template corrections
* bugfix: #1658045 Euro major settings: list countries alphabetically
* bugfix: #1658043 Euro major feature calculates amounts incorrectly
* bugfix: #1658047 euro major Lithuanian template corrections
* bugfix: #1658045 euro major settings: list countries alphabetically
* bugfix: #1658043 euro major feature calculates amounts incorrectly
* bugfix: #1656531 account combobox can be default set to disabled account
* bugfix: #1653957 Importing QIF file with existing accounts
* bugfix: #1652994 Sorting for account in Statistics Report doen't work
* bugfix: #1652527 Balance report crash when no result
* bugfix: #1649081 Exclude from budget option seems ignored
* bugfix: #1649078 Remind operations are included in "today" balance calculation
* bugfix: #1653957 importing QIF file with existing accounts
* bugfix: #1652994 sorting for account in Statistics Report doen't work
* bugfix: #1652527 balance report crash when no result
* bugfix: #1649081 exclude from budget option seems ignored
* bugfix: #1649078 remind operations are included in "today" balance calculation
* bugfix: #1648856 balance report "select all" is not working
......
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for homebank 5.1.3.
# Generated by GNU Autoconf 2.69 for homebank 5.1.4.
#
#
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
......@@ -577,8 +577,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='homebank'
PACKAGE_TARNAME='homebank'
PACKAGE_VERSION='5.1.3'
PACKAGE_STRING='homebank 5.1.3'
PACKAGE_VERSION='5.1.4'
PACKAGE_STRING='homebank 5.1.4'
PACKAGE_BUGREPORT=''
PACKAGE_URL=''
......@@ -1340,7 +1340,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures homebank 5.1.3 to adapt to many kinds of systems.
\`configure' configures homebank 5.1.4 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
......@@ -1407,7 +1407,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of homebank 5.1.3:";;
short | recursive ) echo "Configuration of homebank 5.1.4:";;
esac
cat <<\_ACEOF
......@@ -1515,7 +1515,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
homebank configure 5.1.3
homebank configure 5.1.4
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
......@@ -1934,7 +1934,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by homebank $as_me 5.1.3, which was
It was created by homebank $as_me 5.1.4, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
......@@ -2802,7 +2802,7 @@ fi
# Define the identity of the package.
PACKAGE='homebank'
VERSION='5.1.3'
VERSION='5.1.4'
cat >>confdefs.h <<_ACEOF
......@@ -4626,12 +4626,12 @@ if test -n "$DEPS_CFLAGS"; then
pkg_cv_DEPS_CFLAGS="$DEPS_CFLAGS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtk+-3.0 >= 3.12 glib-2.0 >= 2.39\""; } >&5
($PKG_CONFIG --exists --print-errors "gtk+-3.0 >= 3.12 glib-2.0 >= 2.39") 2>&5
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtk+-3.0 >= 3.16 glib-2.0 >= 2.39\""; } >&5
($PKG_CONFIG --exists --print-errors "gtk+-3.0 >= 3.16 glib-2.0 >= 2.39") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_DEPS_CFLAGS=`$PKG_CONFIG --cflags "gtk+-3.0 >= 3.12 glib-2.0 >= 2.39" 2>/dev/null`
pkg_cv_DEPS_CFLAGS=`$PKG_CONFIG --cflags "gtk+-3.0 >= 3.16 glib-2.0 >= 2.39" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
......@@ -4643,12 +4643,12 @@ if test -n "$DEPS_LIBS"; then
pkg_cv_DEPS_LIBS="$DEPS_LIBS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtk+-3.0 >= 3.12 glib-2.0 >= 2.39\""; } >&5
($PKG_CONFIG --exists --print-errors "gtk+-3.0 >= 3.12 glib-2.0 >= 2.39") 2>&5
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtk+-3.0 >= 3.16 glib-2.0 >= 2.39\""; } >&5
($PKG_CONFIG --exists --print-errors "gtk+-3.0 >= 3.16 glib-2.0 >= 2.39") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_DEPS_LIBS=`$PKG_CONFIG --libs "gtk+-3.0 >= 3.12 glib-2.0 >= 2.39" 2>/dev/null`
pkg_cv_DEPS_LIBS=`$PKG_CONFIG --libs "gtk+-3.0 >= 3.16 glib-2.0 >= 2.39" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
......@@ -4669,14 +4669,14 @@ else
_pkg_short_errors_supported=no
fi
if test $_pkg_short_errors_supported = yes; then
DEPS_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gtk+-3.0 >= 3.12 glib-2.0 >= 2.39" 2>&1`
DEPS_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gtk+-3.0 >= 3.16 glib-2.0 >= 2.39" 2>&1`
else
DEPS_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gtk+-3.0 >= 3.12 glib-2.0 >= 2.39" 2>&1`
DEPS_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gtk+-3.0 >= 3.16 glib-2.0 >= 2.39" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$DEPS_PKG_ERRORS" >&5
as_fn_error $? "Package requirements (gtk+-3.0 >= 3.12 glib-2.0 >= 2.39) were not met:
as_fn_error $? "Package requirements (gtk+-3.0 >= 3.16 glib-2.0 >= 2.39) were not met:
$DEPS_PKG_ERRORS
......@@ -4851,7 +4851,7 @@ fi
# release flags
# general usage flags
CFLAGS="${CFLAGS} -Wall -Wmissing-prototypes"
# disable deprecated warnings
......@@ -6999,7 +6999,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by homebank $as_me 5.1.3, which was
This file was extended by homebank $as_me 5.1.4, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
......@@ -7065,7 +7065,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
homebank config.status 5.1.3
homebank config.status 5.1.4
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
......
......@@ -2,7 +2,7 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.52)
AC_INIT([homebank], [5.1.3])
AC_INIT([homebank], [5.1.4])
#AC_INIT([homebank], [x.x-rc])
AM_CONFIG_HEADER(config.h)
......@@ -22,7 +22,7 @@ AC_PROG_INSTALL
AC_PROG_INTLTOOL
# Checks for libraries.
PKG_CHECK_MODULES(DEPS, gtk+-3.0 >= 3.12 glib-2.0 >= 2.39)
PKG_CHECK_MODULES(DEPS, gtk+-3.0 >= 3.16 glib-2.0 >= 2.39)
AC_SUBST(DEPS_CFLAGS)
AC_SUBST(DEPS_LIBS)
AC_CHECK_LIB(m, pow)
......@@ -31,7 +31,7 @@ PKG_CHECK_MODULES(LIBSOUP, [libsoup-2.4 >= 2.26])
AC_SUBST(LIBSOUP_CFLAGS)
AC_SUBST(LIBSOUP_LIBS)
# release flags
# general usage flags
CFLAGS="${CFLAGS} -Wall -Wmissing-prototypes"
# disable deprecated warnings
......
......@@ -11,8 +11,8 @@
<p><img src="images/web_title.png"><br></p>
<p>&copy; Copyright 1995-2017 by Maxime Doyen<br>
All Rights Reserved</p>
<p>Version: 5.1.3<br>
Compilation date: January 22th, 2017</p><br>
<p>Version: 5.1.4<br>
Compilation date: February 16th, 2017</p><br>
</div>
</body>
</html>
......@@ -199,11 +199,14 @@ static void ui_multipleedit_dialog_apply( GtkWidget *widget, gpointer user_data
struct ui_multipleedit_dialog_data *data;
GtkTreeModel *model;
GList *selection, *list;
guint changes;
data = g_object_get_data(G_OBJECT(gtk_widget_get_ancestor(widget, GTK_TYPE_WINDOW)), "inst_data");
DB( g_print ("\n[ui-multipleedit] apply\n") );
changes = GLOBALS->changes_count;
model = gtk_tree_view_get_model(GTK_TREE_VIEW(data->treeview));
selection = gtk_tree_selection_get_selected_rows(gtk_tree_view_get_selection(GTK_TREE_VIEW(data->treeview)), &model);
......@@ -259,13 +262,11 @@ GList *selection, *list;
if( gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(data->CM_acc)) )
{
guint32 nkacc = ui_acc_comboboxentry_get_key(GTK_COMBO_BOX(data->PO_acc));
account_balances_sub(txn);
if( transaction_acc_move(txn, txn->kacc, nkacc) )
{
GtkTreeIter iter;
account_balances_add(txn);
DB( g_print(" -> acc: '%d'\n", nkacc) );
gtk_tree_model_get_iter(model, &iter, list->data);
gtk_list_store_remove(GTK_LIST_STORE(model), &iter);
......@@ -354,14 +355,9 @@ GList *selection, *list;
if( data->has_xfer && txn->paymode == PAYMODE_INTXFER )
{
Transaction *ltxn;
ltxn = transaction_xfer_child_strong_get(txn);
if(ltxn != NULL) //should never be the case
{
DB( g_print(" - strong link found, do sync\n") );
transaction_xfer_sync_child(txn, ltxn);
}
Transaction *child;
child = transaction_xfer_child_strong_get(txn);
transaction_xfer_child_sync(txn, child);
}
list = g_list_previous(list);
......@@ -370,6 +366,11 @@ GList *selection, *list;
g_list_foreach(selection, (GFunc)gtk_tree_path_free, NULL);
g_list_free(selection);
//refresh main
if( GLOBALS->changes_count > changes )
ui_mainwindow_update(GLOBALS->mainwindow, GINT_TO_POINTER(UF_TITLE+UF_SENSITIVE));
}
......@@ -747,7 +748,6 @@ gint count;
{
GList *tmplist = g_list_first(badxferlist);
while (tmplist != NULL)
{
Transaction *stxn = tmplist->data;
......@@ -840,6 +840,10 @@ gboolean usermode = TRUE;
count);
}
//refresh main
if( count > 0 )
ui_mainwindow_update(GLOBALS->mainwindow, GINT_TO_POINTER(UF_TITLE+UF_SENSITIVE));
}
......@@ -1196,10 +1200,13 @@ gushort lpos = 1;
//#1267344
if(!(ope->status == TXN_STATUS_REMIND))
balance += ope->amount;
balance += ope->amount;
ope->balance = balance;
//#1661806
ope->overdraft = (ope->balance < data->acc->minimum) ? TRUE : FALSE;
if(ope->date == ldate)
{
ope->pos = ++lpos;
......@@ -1475,6 +1482,7 @@ static void register_panel_action(GtkWidget *widget, gpointer user_data)
{
struct register_panel_data *data;
gint action = GPOINTER_TO_INT(user_data);
guint changes = GLOBALS->changes_count;
gboolean result;
DB( g_print("\n[account] action\n") );
......@@ -1572,6 +1580,8 @@ gboolean result;
if(result == GTK_RESPONSE_ACCEPT)
{
//manage current window display stuff
//#1270687: sort if date changed
if(old_txn->date != new_txn->date)
data->do_sort = TRUE;
......@@ -1814,6 +1824,10 @@ gboolean result;
}
//refresh main
if( GLOBALS->changes_count > changes )
ui_mainwindow_update(GLOBALS->mainwindow, GINT_TO_POINTER(UF_TITLE+UF_SENSITIVE));
}
......@@ -2422,7 +2436,7 @@ GError *error = NULL;
GtkAccelGroup *ag = gtk_ui_manager_get_accel_group (ui);
DB( g_print(" - add_accel_group actions=%x, ui=%x, ag=%x\n", (gint)actions, (gint)ui, (gint)ag) );
DB( g_print(" - add_accel_group actions=%p, ui=%p, ag=%p\n", actions, ui, ag) );
gtk_window_add_accel_group (GTK_WINDOW (window), ag);
......@@ -2634,7 +2648,7 @@ GError *error = NULL;
/* setup to moove later */
data->filter = da_filter_malloc();
DB( g_print(" - filter ok %x\n", (gint)data->filter) );
DB( g_print(" - filter ok %p\n", data->filter) );
return window;
......
......@@ -144,6 +144,8 @@ void ui_mainwindow_scheduled_postall(GtkWidget *widget, gpointer user_data);
void ui_mainwindow_recent_add (struct hbfile_data *data, const gchar *path);
static void ui_panel_accounts_setup(struct hbfile_data *data);
extern gchar *CYA_ACC_TYPE[];
gchar *CYA_CATSUBCAT[] = {
......@@ -539,13 +541,11 @@ static void ui_mainwindow_action_quit(void)
{
gboolean result;
//gtk_widget_destroy(GLOBALS->mainwindow);
//emulate the wm close button
g_signal_emit_by_name(GLOBALS->mainwindow, "delete-event", NULL, &result);
//gtk_main_quit();
}
static void ui_mainwindow_action_file_statistics(void)
{
ui_dialog_file_statistics();
......@@ -1036,6 +1036,7 @@ gboolean file_clear = GPOINTER_TO_INT(user_data);
gtk_list_store_clear(GTK_LIST_STORE(gtk_tree_view_get_model(GTK_TREE_VIEW(data->LV_top))));
data->showall = FALSE;
ui_panel_accounts_setup(data);
hbfile_cleanup(file_clear);
hbfile_setup(file_clear);
......@@ -1480,6 +1481,8 @@ static void ui_mainwindow_scheduled_post_cb(GtkWidget *widget, gpointer user_dat
{
struct hbfile_data *data = user_data;
DB( g_print("\n[ui-mainwindow] scheduled post\n") );
Archive *arc = ui_mainwindow_scheduled_get_selected_item(GTK_TREE_VIEW(data->LV_upc));
if( (arc != NULL) )
......@@ -1998,16 +2001,33 @@ gpointer key, value;
{
GPtrArray *gpa = value;
gdouble tbank, ttoday, tfuture;
gint position;
if(gpa != NULL)
{
nbtype++;
//1: Header: Bank, Cash, ...
//DB( g_print(" - append type '%s'\n", CYA_ACC_TYPE[i]) );
DB( g_print("\n - append type '%d'\n", key) );
DB( g_print("\n - append type '%s'\n", (gchar *)key) );
//#1663399 keep type position like in dropdown
position = 0;
if( PREFS->pnl_acc_show_by == DSPACC_GROUP_BY_TYPE )
{
gint t = 0;
while(CYA_ACC_TYPE[t] != NULL && t < 15)
{
if( !strcmp(CYA_ACC_TYPE[t], key) )
break;
t++;
}
position = t;
}
gtk_tree_store_append (GTK_TREE_STORE(model), &iter1, NULL);
gtk_tree_store_set (GTK_TREE_STORE(model), &iter1,
LST_DSPACC_POS, position,
LST_DSPACC_DATATYPE, DSPACC_TYPE_HEADER,
LST_DSPACC_NAME, key,
-1);
......@@ -2118,7 +2138,7 @@ gint flags;
gchar *basename;
gchar *changed;
DB( g_print(" + 1: wintitle %x\n", data->wintitle) );
DB( g_print(" + 1: wintitle %p\n", data->wintitle) );
basename = g_path_get_basename(GLOBALS->xhb_filepath);
......@@ -2334,6 +2354,14 @@ static void
}
}
static void ui_mainwindow_destroy(GtkTreeView *treeview, gpointer user_data)
{
DB( g_print("\n[ui-mainwindow] destroy\n") );
}
/*
**
*/
......@@ -2343,7 +2371,7 @@ struct hbfile_data *data = user_data;
struct WinGeometry *wg;
gboolean retval = FALSE;
DB( g_print("\n[ui-mainwindow] dispose\n") );
DB( g_print("\n[ui-mainwindow] delete-event\n") );
//store position and size
wg = &PREFS->wal_wg;
......@@ -2367,19 +2395,18 @@ gboolean retval = FALSE;
}
else
{
DB( g_print(" free wintitle %x\n", data->wintitle) );
//todo: retval is useless and below should move to destroy
retval = TRUE;
gtk_widget_destroy(data->LV_top);
g_free(data->wintitle);
da_filter_free(data->filter);
g_free(user_data);
gtk_main_quit();
}
//delete-event TRUE abort/FALSE destroy
//TRUE:stop other handlers from being invoked for the event | FALSE: propagate
return retval;
}
......@@ -2792,11 +2819,37 @@ GVariant *old_state, *new_state;
static const GActionEntry actions[] = {
// { "paste", activate_action, NULL, NULL, NULL, {0,0,0} },
{ "showall" , activate_toggle, NULL, "false", NULL, {0,0,0} },
{ "groupby", activate_radio, "s", "'type'", NULL, {0,0,0} }
{ "showall", activate_toggle, NULL, "false" , NULL, {0,0,0} },
{ "groupby", activate_radio , "s", "'type'", NULL, {0,0,0} }
};
static void ui_panel_accounts_setup(struct hbfile_data *data)
{
GAction *action;
GVariant *new_state;
if( !G_IS_SIMPLE_ACTION_GROUP(data->action_group_acc) )
return;
action = g_action_map_lookup_action (G_ACTION_MAP (data->action_group_acc), "showall");
if( action )
{
new_state = g_variant_new_boolean (data->showall);
g_simple_action_set_state (G_SIMPLE_ACTION(action), new_state);
}
action = g_action_map_lookup_action (G_ACTION_MAP (data->action_group_acc), "groupby");
if( action )
{
const gchar *value = (PREFS->pnl_acc_show_by == DSPACC_GROUP_BY_TYPE) ? "type" : "bank";
new_state = g_variant_new_string (value);
g_simple_action_set_state (G_SIMPLE_ACTION (action), new_state);
}
}
static GtkWidget *ui_mainwindow_create_youraccounts(struct hbfile_data *data)
{
GtkWidget *panel, *label, *widget, *sw, *tbar, *hbox, *image;
......@@ -2850,16 +2903,6 @@ GtkToolItem *toolitem;
//gmenu test (see test folder into gtk)
widget = gtk_menu_button_new();
gtk_menu_button_set_direction (GTK_MENU_BUTTON(widget), GTK_ARROW_UP);
gtk_widget_set_halign (widget, GTK_ALIGN_END);
image = gtk_image_new_from_icon_name (ICONNAME_EMBLEM_SYSTEM, GTK_ICON_SIZE_MENU);
g_object_set (widget, "image", image, NULL);
toolitem = gtk_tool_item_new();
gtk_container_add (GTK_CONTAINER(toolitem), widget);
gtk_toolbar_insert(GTK_TOOLBAR(tbar), GTK_TOOL_ITEM(toolitem), -1);
GMenu *menu, *section;
menu = g_menu_new ();
......@@ -2878,15 +2921,21 @@ GMenu *menu, *section;
GSimpleActionGroup *group = g_simple_action_group_new ();
data->action_group_acc = group;
g_action_map_add_action_entries (G_ACTION_MAP (group), actions, G_N_ELEMENTS (actions), data);
//init radio
GAction *action = g_action_map_lookup_action (G_ACTION_MAP (group), "groupby");
const gchar *value = (PREFS->pnl_acc_show_by == DSPACC_GROUP_BY_TYPE) ? "type" : "bank";
g_simple_action_set_state (G_SIMPLE_ACTION (action), g_variant_new_string (value));
gtk_widget_insert_action_group (widget, "actions", G_ACTION_GROUP(group));
widget = gtk_menu_button_new();
gtk_menu_button_set_direction (GTK_MENU_BUTTON(widget), GTK_ARROW_UP);
gtk_widget_set_halign (widget, GTK_ALIGN_END);
image = gtk_image_new_from_icon_name (ICONNAME_EMBLEM_SYSTEM, GTK_ICON_SIZE_MENU);
g_object_set (widget, "image", image, NULL);
toolitem = gtk_tool_item_new();
gtk_container_add (GTK_CONTAINER(toolitem), widget);
gtk_toolbar_insert(GTK_TOOLBAR(tbar), GTK_TOOL_ITEM(toolitem), -1);
gtk_widget_insert_action_group (widget, "actions", G_ACTION_GROUP(group));
gtk_menu_button_set_menu_model (GTK_MENU_BUTTON (widget), G_MENU_MODEL (menu));
return panel;
......@@ -3059,7 +3108,7 @@ GtkAction *action;
//store our window private data
g_object_set_data(G_OBJECT(window), "inst_data", (gpointer)data);
DB( g_print(" - new window=%x, inst_data=%0x\n", window, data) );
DB( g_print(" - new window=%p, inst_data=%p\n", window, data) );
// this is our mainwindow, so store it to GLOBALS data
data->window = window;
......@@ -3095,21 +3144,16 @@ GtkWidget *bar, *label;
gtk_paned_pack1 (GTK_PANED(vpaned), hpaned, FALSE, FALSE);
widget = ui_mainwindow_scheduled_create(data);
gtk_paned_pack2 (GTK_PANED(vpaned), widget, FALSE, FALSE);
gtk_paned_pack2 (GTK_PANED(vpaned), widget, TRUE, FALSE);
widget = ui_mainwindow_create_youraccounts(data);
//gtk_widget_set_size_request (widget, 100, -1);
gtk_paned_pack1 (GTK_PANED(hpaned), widget, FALSE, FALSE);
widget = ui_mainwindow_create_topspending(data);
gtk_paned_pack2 (GTK_PANED(hpaned), widget, FALSE, FALSE);
DB( g_print(" - vpaned=%d hpaned=%d\n", PREFS->wal_vpaned, PREFS->wal_hpaned) );
//gtk_widget_set_size_request (widget, -1, 100);
gtk_paned_pack2 (GTK_PANED(hpaned), widget, TRUE, FALSE);
if(PREFS->wal_hpaned > 0)
gtk_paned_set_position(GTK_PANED(data->hpaned), PREFS->wal_hpaned);
if(PREFS->wal_vpaned > 0)
gtk_paned_set_position(GTK_PANED(data->vpaned), PREFS->wal_vpaned);
//setup, init and show window
wg = &PREFS->wal_wg;
......@@ -3122,7 +3166,15 @@ GtkWidget *bar, *label;
gtk_window_maximize(GTK_WINDOW(window));
gtk_widget_show_all (window);
//#1662197/1660910 moved after resize/show
DB( g_print(" - vpaned=%d hpaned=%d\n", PREFS->wal_vpaned, PREFS->wal_hpaned) );
if(PREFS->wal_hpaned > 0)
gtk_paned_set_position(GTK_PANED(data->hpaned), PREFS->wal_hpaned);
if(PREFS->wal_vpaned > 0)
gtk_paned_set_position(GTK_PANED(data->vpaned), PREFS->wal_vpaned);
//todo: move this elsewhere
DB( g_print(" - setup stuff\n") );
......@@ -3176,6 +3228,7 @@ GtkWidget *bar, *label;
/* GtkWindow events */
g_signal_connect (window, "delete-event", G_CALLBACK (ui_mainwindow_dispose), (gpointer)data);
g_signal_connect (window, "destroy", G_CALLBACK (ui_mainwindow_destroy), NULL);
g_signal_connect (window, "screen-changed",
......
......@@ -34,6 +34,7 @@ struct hbfile_data
GtkWidget *BT_expandall;
GtkWidget *BT_collapseall;
gboolean showall;
GSimpleActionGroup *action_group_acc;
GtkWidget *GR_top;
GtkWidget *LV_top;
......
......@@ -29,7 +29,7 @@ char *chart_colors[] =
"Quicken",
"Office 2010",
"Office 2013",
"Analytics",
"Analytics",
"YNAB",
NULL
};
......
......@@ -20,6 +20,7 @@
#include <math.h>
#include <string.h>
#include <gtk/gtk.h>
#include "homebank.h"
......
......@@ -1290,8 +1290,17 @@ gint first, i;
{
if(chart->minimum != 0 && chart->minimum >= chart->min)
{
y = 0.5 + chart->oy + (ABS(chart->minimum)/chart->range) * chart->graph_height;
if( chart->minimum < 0 )
{
y = 0.5 + chart->oy + (ABS(chart->minimum)/chart->range) * chart->graph_height;
}
else
{
y = 0.5 + chart->oy - (ABS(chart->minimum)/chart->range) * chart->graph_height;
}
y2 = (ABS(chart->min)/chart->range) * chart->graph_height - (y - chart->oy) + 1;
cairo_set_source_rgba(cr, COLTOCAIRO(255), COLTOCAIRO(0), COLTOCAIRO(0), AREA_ALPHA / 2);
DB( g_print(" draw over: x%f, y%f, w%f, h%f\n", chart->l, y, chart->w, y2) );
......
......@@ -148,6 +148,8 @@ Payee *pay;
Archive *da_archive_init_from_transaction(Archive *arc, Transaction *txn)
{
DB( g_print("\n[scheduled] init from txn\n") );
//fill it
arc->amount = txn->amount;
arc->kacc = txn->kacc;
......@@ -171,14 +173,16 @@ Archive *da_archive_init_from_transaction(Archive *arc, Transaction *txn)
static guint32 _sched_date_get_next_post(Archive *arc, guint32 nextdate)
static guint32 _sched_date_get_next_post(GDate *tmpdate, Archive *arc, guint32 nextdate)
{
GDate *tmpdate;
guint32 nextpostdate = nextdate;
DB( g_print("\n[scheduled] _sched_date_get_next_post\n") );
//DB( g_print("\n[scheduled] date_get_next_post\n") );
g_date_set_julian(tmpdate, nextpostdate);
//DB( g_print("in : %2d-%2d-%4d\n", g_date_get_day(tmpdate), g_date_get_month (tmpdate), g_date_get_year(tmpdate) ) );
tmpdate = g_date_new_julian(nextpostdate);
switch(arc->unit)
{
case AUTO_UNIT_DAY:
......@@ -195,9 +199,11 @@ guint32 nextpostdate = nextdate;
break;
}
//DB( g_print("out: %2d-%2d-%4d\n", g_date_get_day(tmpdate), g_date_get_month (tmpdate), g_date_get_year(tmpdate) ) );
/* get the final post date and free */
nextpostdate = g_date_get_julian(tmpdate);
g_date_free(tmpdate);
return nextpostdate;
}
......@@ -222,7 +228,7 @@ GDateWeekday wday;
guint32 finalpostdate;
gint shift;
DB( g_print("\n[scheduled] scheduled_get_postdate\n") );
DB( g_print("\n[scheduled] get_postdate\n") );
finalpostdate = postdate;
......@@ -264,10 +270,14 @@ gint shift;
guint32 scheduled_get_latepost_count(Archive *arc, guint32 jrefdate)
{
guint32 curdate = jrefdate - arc->nextdate;
GDate *post_date;
guint32 curdate;
guint32 nblate = 0;
//DB( g_print("\n[scheduled] get_latepost_count\n") );
/*
curdate = jrefdate - arc->nextdate;
switch(arc->unit)
{