commit homebank for openSUSE:Factory
Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package homebank for openSUSE:Factory checked in at 2024-10-09 22:14:02 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/homebank (Old) and /work/SRC/openSUSE:Factory/.homebank.new.19354 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "homebank" Wed Oct 9 22:14:02 2024 rev:51 rq:1206546 version:5.8.5 Changes: -------- --- /work/SRC/openSUSE:Factory/homebank/homebank.changes 2024-09-30 15:40:11.084480955 +0200 +++ /work/SRC/openSUSE:Factory/.homebank.new.19354/homebank.changes 2024-10-09 22:14:32.678250832 +0200 @@ -1,0 +2,22 @@ +Tue Oct 8 16:21:18 UTC 2024 - Carsten Ziepke <kieltux@gmail.com> + +- Update to 5.8.5: + * bugfix: date button shortened in ledger book +- Changes in 5.8.4: + * bugfix: prevent some problems with xfer and both legder + window opened + * bugfix: lp#2083124 account rename doesn't allow case correction + * bugfix: lp#2081574 windows: budget report date fields not + showing in their entirety + * bugfix: lp#2081379 planned split operations are not modified + after a category merge + * bugfix: lp#2080864 HomeBank CLI --version or -V no longer + works in linux + * bugfix: lp#2080756 balance change from ledger toolbar not + updated for xfer target + * bugfix: lp#2080032 your accounts print/export hidden columns + * bugfix: lp#2079884 ledger window snap half left oversize + * bugfix: lp#2036404 grouped budget categories not showing + total amount + +------------------------------------------------------------------- Old: ---- homebank-5.8.3.tar.gz New: ---- homebank-5.8.5.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ homebank.spec ++++++ --- /var/tmp/diff_new_pack.E29JK5/_old 2024-10-09 22:14:33.394280693 +0200 +++ /var/tmp/diff_new_pack.E29JK5/_new 2024-10-09 22:14:33.394280693 +0200 @@ -17,7 +17,7 @@ Name: homebank -Version: 5.8.3 +Version: 5.8.5 Release: 0 Summary: Application to manage personal accounts License: GPL-2.0-or-later ++++++ homebank-5.8.3.tar.gz -> homebank-5.8.5.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/homebank-5.8.3/ChangeLog new/homebank-5.8.5/ChangeLog --- old/homebank-5.8.3/ChangeLog 2024-09-08 09:17:31.000000000 +0200 +++ new/homebank-5.8.5/ChangeLog 2024-10-05 08:46:11.000000000 +0200 @@ -1,5 +1,27 @@ +2024-10-05 Maxime Doyen + + Made 5.8.5 release + + * bugfix: date button shortened in ledger book + + +2024-10-04 Maxime Doyen + + Made 5.8.4 release + + * bugfix: prevent some problems with xfer and both legder window opened + * bugfix: #2083124 account rename doesn't allow case correction + * bugfix: #2081574 windows: budget report date fields not showing in their entirety + * bugfix: #2081379 planned split operations are not modified after a category merge + * bugfix: #2080864 HomeBank CLI --version or -V no longer works in linux + * bugfix: #2080756 balance change from ledger toolbar not updated for xfer target + * bugfix: #2080032 your accounts print/export hidden columns + * bugfix: #2079884 ledger window snap half left oversize + * bugfix: #2036404 grouped budget categories not showing total amount + + 2024-09-08 Maxime Doyen Made 5.8.3 release diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/homebank-5.8.3/configure new/homebank-5.8.5/configure --- old/homebank-5.8.3/configure 2024-08-10 09:50:29.000000000 +0200 +++ new/homebank-5.8.5/configure 2024-10-05 08:55:54.000000000 +0200 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.71 for homebank 5.8.3. +# Generated by GNU Autoconf 2.71 for homebank 5.8.5. # # # Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation, @@ -607,8 +607,8 @@ # Identity of this package. PACKAGE_NAME='homebank' PACKAGE_TARNAME='homebank' -PACKAGE_VERSION='5.8.3' -PACKAGE_STRING='homebank 5.8.3' +PACKAGE_VERSION='5.8.5' +PACKAGE_STRING='homebank 5.8.5' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -1365,7 +1365,7 @@ # 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.8.3 to adapt to many kinds of systems. +\`configure' configures homebank 5.8.5 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1432,7 +1432,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of homebank 5.8.3:";; + short | recursive ) echo "Configuration of homebank 5.8.5:";; esac cat <<\_ACEOF @@ -1540,7 +1540,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -homebank configure 5.8.3 +homebank configure 5.8.5 generated by GNU Autoconf 2.71 Copyright (C) 2021 Free Software Foundation, Inc. @@ -1815,7 +1815,7 @@ 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.8.3, which was +It was created by homebank $as_me 5.8.5, which was generated by GNU Autoconf 2.71. Invocation command line was $ $0$ac_configure_args_raw @@ -3089,7 +3089,7 @@ # Define the identity of the package. PACKAGE='homebank' - VERSION='5.8.3' + VERSION='5.8.5' printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h @@ -7256,7 +7256,7 @@ # 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.8.3, which was +This file was extended by homebank $as_me 5.8.5, which was generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -7324,7 +7324,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ -homebank config.status 5.8.3 +homebank config.status 5.8.5 configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/homebank-5.8.3/configure.ac new/homebank-5.8.5/configure.ac --- old/homebank-5.8.3/configure.ac 2024-08-10 09:48:54.000000000 +0200 +++ new/homebank-5.8.5/configure.ac 2024-10-05 08:54:48.000000000 +0200 @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ([2.71]) -AC_INIT([homebank],[5.8.3]) +AC_INIT([homebank],[5.8.5]) #AC_INIT([homebank],[x.x-rc]) AC_CONFIG_HEADERS(config.h) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/homebank-5.8.3/doc/dlg-curr.html new/homebank-5.8.5/doc/dlg-curr.html --- old/homebank-5.8.3/doc/dlg-curr.html 2023-11-11 21:00:08.000000000 +0100 +++ new/homebank-5.8.5/doc/dlg-curr.html 2024-10-04 09:35:39.000000000 +0200 @@ -85,18 +85,22 @@ </p> <p>Since 5.7.2: there is a log widget that track call and return of the API for debug purpose.</p> - <h3>Compatible APIs</h3> +<h3>Default API</h3> <ul> - <li>⧉ <a href="https://frankfurter.app" target="_blank">frankfurter.app</a> (this is the default)<br> + <li>⧉ <a href="https://frankfurter.app" target="_blank">frankfurter.app</a><br> (no apikey): 30 currencies, Euro limited <a href="https://www.ecb.europa.eu/stats/policy_and_exchange_rates/euro_reference_exc..." target="_blank">listed here</a><br> example call: <code>https://api.frankfurter.app/latest?base=EUR&symbols=USD,JPY,GBP</code> </li> + </ul> + +<h3>Compatible APIs</h3> + <ul> <li>⧉ <a href="https://fixer.io" target="_blank">fixer.io</a><br> - (apikey): 170 world currencies, including Bitcoin, Gold and Silver rates. <a href="https://data.fixer.io/api/symbols?%20access_key=API_KEY" target="_blank">listed here</a><br> + (apikey): 170 world currencies, including Bitcoin, Gold and Silver rates. <a href="http://data.fixer.io/api/symbols?access_key=API_KEY" target="_blank">listed here</a><br> example call: <code>http://data.fixer.io/api/latest?access_key=YOUR_ACCESS_KEY&base=EUR&symbols=USD,JPY,GBP</code> </li> <li>⧉ <a href="https://exchangerate.host" target="_blank">exchangerate.host</a><br> - (apikey): 170 world currencies, including Bitcoin, Gold and Silver rates. <a href="https://api.exchangerate.host/symbols" target="_blank">listed here</a><br> + (apikey): 170 world currencies, including Bitcoin, Gold and Silver rates. <a href="http://api.exchangerate.host/symbols" target="_blank">listed here</a><br> example call: <code>http://api.exchangerate.host/list?access_key=YOUR_ACCESS_KEY&base=EUR&symbols=USD,JPY,GBP</code> </li> </ul> @@ -105,7 +109,7 @@ <code> - https://api.frankfurter.app/latest<br> - http://data.fixer.io/api/latest<br> - - http://api.exchangerate.host/list<br> + - http://api.exchangerate.host/live<br> </code> </p> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/homebank-5.8.3/doc/dlg-pref.html new/homebank-5.8.5/doc/dlg-pref.html --- old/homebank-5.8.3/doc/dlg-pref.html 2024-05-11 12:51:36.000000000 +0200 +++ new/homebank-5.8.5/doc/dlg-pref.html 2024-10-04 09:35:51.000000000 +0200 @@ -105,8 +105,9 @@ </tr> <tr> <th>Dark theme</th> - <td>For GNU/Linux users the theme will follow the desktop preference<br> - For other users, well, you know what this is about right ?</td> + <td>On GNU/Linux OS, HomeBank will follow the dark scheme preference if available, and + this option will be used ONLY if it is set to DEFAULT mode which is light, to enable force to dark mode.<br> + For other OS this enable to switch to theme dark mode, if available.</td> </tr> </table> @@ -605,4 +606,4 @@ </div> </body> -</html> \ No newline at end of file +</html> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/homebank-5.8.3/doc/frm-main.html new/homebank-5.8.5/doc/frm-main.html --- old/homebank-5.8.3/doc/frm-main.html 2024-09-08 09:16:23.000000000 +0200 +++ new/homebank-5.8.5/doc/frm-main.html 2024-10-04 09:36:36.000000000 +0200 @@ -10,8 +10,8 @@ <div class="mainpage"> <p><img src="images/web_title.png"><br></p> - <p>Version: 5.8.3<br> - Compilation date: Sep 8th, 2024</p><br> + <p>Version: 5.8.4<br> + Compilation date: Oct 4th, 2024</p><br> <p>© Copyright 1995-2024 by Maxime Doyen<br> All Rights Reserved</p> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/homebank-5.8.3/src/dsp-account.c new/homebank-5.8.5/src/dsp-account.c --- old/homebank-5.8.3/src/dsp-account.c 2024-06-09 16:52:20.000000000 +0200 +++ new/homebank-5.8.5/src/dsp-account.c 2024-10-05 08:42:18.000000000 +0200 @@ -1189,19 +1189,31 @@ //#492755 removed 4.3 let the child transfer unchanged //#2019193 option the sync xfer status - if( PREFS->xfer_syncstat == TRUE ) + if( txn->flags & OF_INTXFER ) { - if( txn->flags & OF_INTXFER ) + if( PREFS->xfer_syncstat == TRUE ) { Transaction *child = transaction_xfer_child_strong_get(txn); + if(child != NULL) { + GtkWindow *accwin = homebank_app_find_window(txn->kxferacc); + + //#2080756 recompute bal + account_balances_sub(child); child->status = txn->status; child->flags |= OF_CHANGED; + account_balances_add(child); + + //#2080756 if open refresh target account balances + if(accwin != NULL) + { + DB( g_print(" xfer call refresh %d\n", txn->kxferacc)); + hub_ledger_update(GTK_WIDGET(accwin), GINT_TO_POINTER(FLG_REG_BALANCE)); + } } } } - } @@ -3091,6 +3103,7 @@ gtk_box_pack_start (GTK_BOX (toolbar), hbox, FALSE, FALSE, 0); label = gtk_label_new (_("Reconciled changes is")); + gtk_label_set_ellipsize(GTK_LABEL(label), PANGO_ELLIPSIZE_END); data->LB_lockreconciled = label; gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); @@ -3117,8 +3130,8 @@ { struct hub_ledger_data *data; struct WinGeometry *wg; -GtkWidget *window, *mainvbox, *intbox, *menubar, *table, *scrollwin, *bar; -GtkWidget *treeview, *label, *widget, *image; +GtkWidget *window, *mainvbox, *intbox, *actionbox, *hbox, *table; +GtkWidget *menubar, *bar, *scrollwin, *treeview, *label, *widget, *image; GActionGroup *actions; gint col; @@ -3211,10 +3224,11 @@ mainvbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); gtk_window_set_child(GTK_WINDOW(window), mainvbox); + //1 - menubar menubar = hub_ledger_menubar_create2(data); gtk_box_pack_start (GTK_BOX (mainvbox), menubar, FALSE, FALSE, 0); - // info bar for duplicate + //2 - info bar for duplicate bar = gtk_info_bar_new_with_buttons (_("_Refresh"), HB_RESPONSE_REFRESH, NULL); data->IB_duplicate = bar; gtk_box_pack_start (GTK_BOX (mainvbox), bar, FALSE, FALSE, 0); @@ -3231,105 +3245,87 @@ data->NB_txn_daygap = widget; gtk_box_pack_start (GTK_BOX (gtk_info_bar_get_content_area (GTK_INFO_BAR (bar))), widget, FALSE, FALSE, 0); - // windows interior + //3 - windows interior intbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, SPACING_SMALL); hb_widget_set_margin(GTK_WIDGET(intbox), SPACING_SMALL); gtk_box_pack_start (GTK_BOX (mainvbox), intbox, TRUE, TRUE, 0); - table = gtk_grid_new(); - gtk_grid_set_row_spacing (GTK_GRID (table), SPACING_SMALL); - gtk_grid_set_column_spacing (GTK_GRID (table), SPACING_MEDIUM); - gtk_box_pack_start (GTK_BOX (intbox), table, FALSE, FALSE, 0); - - //Search bar - col = 0; - //label = make_label_widget(_("_Range:")); - //gtk_grid_attach (GTK_GRID(table), label, col, 0, 1, 1); - //col++; - data->CY_range = make_daterange(label, DATE_RANGE_FLAG_CUSTOM_DISABLE); - gtk_grid_attach (GTK_GRID(table), data->CY_range, col, 0, 1, 1); + //3a - actionbox + actionbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, SPACING_MEDIUM); + //gtk_widget_set_hexpand(actionbox, TRUE); + gtk_box_pack_start (GTK_BOX (intbox), actionbox, FALSE, FALSE, 0); + + hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, SPACING_MEDIUM); + gtk_widget_set_halign(hbox, GTK_ALIGN_START); + //gtk_widget_set_hexpand(hbox, TRUE); + scrollwin = make_scrolled_window_ns(GTK_POLICY_AUTOMATIC, GTK_POLICY_NEVER); + //gtk_widget_set_hexpand(scrollwin, TRUE); + gtk_box_pack_start (GTK_BOX (actionbox), scrollwin, TRUE, TRUE, 0); + gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW(scrollwin), hbox); + //gtk_box_prepend (GTK_BOX (actionbox), hbox); - col++; - widget = gtk_toggle_button_new(); - //image = gtk_image_new_from_icon_name (ICONNAME_HB_OPE_FUTURE, GTK_ICON_SIZE_MENU); - image = gtk_image_new(); - g_object_set(image, "icon-name", ICONNAME_HB_OPE_FUTURE, NULL); - g_object_set (widget, "image", image, NULL); - data->CM_future = widget; - gtk_grid_attach (GTK_GRID(table), widget, col, 0, 1, 1); + widget = make_daterange(NULL, DATE_RANGE_FLAG_CUSTOM_DISABLE); + data->CY_range = widget; + gtk_box_pack_start (GTK_BOX (hbox), widget, FALSE, FALSE, 0); - //#2008521 set more accurate tooltip - gchar *tt = g_strdup_printf(_("Toggle show %d days ahead"), PREFS->date_future_nbdays); - gtk_widget_set_tooltip_text (widget, tt); - g_free(tt); + widget = gtk_toggle_button_new(); + //image = gtk_image_new_from_icon_name (ICONNAME_HB_OPE_FUTURE, GTK_ICON_SIZE_MENU); + image = gtk_image_new(); + g_object_set(image, "icon-name", ICONNAME_HB_OPE_FUTURE, NULL); + g_object_set (widget, "image", image, NULL); + data->CM_future = widget; + //#2008521 set more accurate tooltip + gchar *tt = g_strdup_printf(_("Toggle show %d days ahead"), PREFS->date_future_nbdays); + gtk_widget_set_tooltip_text (widget, tt); + g_free(tt); + gtk_box_pack_start (GTK_BOX (hbox), widget, FALSE, FALSE, 0); //5.8 flag - col++; - label = NULL; - data->CY_flag = make_fltgrpflag(label); - gtk_grid_attach (GTK_GRID(table), data->CY_flag, col, 0, 1, 1); - - //col++; - //label = make_label_widget(_("_Type:")); - //gtk_grid_attach (GTK_GRID(table), label, col, 0, 1, 1); - col++; - data->CY_type = hbtk_combo_box_new_with_data(label, CYA_FLT_TYPE); - gtk_grid_attach (GTK_GRID(table), data->CY_type, col, 0, 1, 1); + widget = make_fltgrpflag(NULL); + data->CY_flag = widget; + gtk_box_pack_start (GTK_BOX (hbox), widget, FALSE, FALSE, 0); - //col++; - //label = make_label_widget(_("_Status:")); - //gtk_grid_attach (GTK_GRID(table), label, col, 0, 1, 1); - col++; - data->CY_status = hbtk_combo_box_new_with_data(label, CYA_FLT_STATUS); - gtk_grid_attach (GTK_GRID(table), data->CY_status, col, 0, 1, 1); + widget = hbtk_combo_box_new_with_data(label, CYA_FLT_TYPE); + data->CY_type = widget; + gtk_box_pack_start (GTK_BOX (hbox), widget, FALSE, FALSE, 0); + + widget = hbtk_combo_box_new_with_data(label, CYA_FLT_STATUS); + data->CY_status = widget; + gtk_box_pack_start (GTK_BOX (hbox), widget, FALSE, FALSE, 0); + //5.8 beta test + if( data->showall ) + { + widget = create_popover_widget(GTK_WINDOW(data->window), data->filter); + data->PO_hubfilter = widget; + gtk_box_pack_start (GTK_BOX (hbox), widget, FALSE, FALSE, 0); + } - //5.8 beta test - if( data->showall ) - { - col++; - widget = create_popover_widget(GTK_WINDOW(data->window), data->filter); - data->PO_hubfilter = widget; - gtk_grid_attach (GTK_GRID(table), widget, col, 0, 1, 1); - } - col++; widget = make_image_button(ICONNAME_HB_FILTER, _("Edit filter")); data->BT_filter = widget; - gtk_grid_attach (GTK_GRID(table), widget, col, 0, 1, 1); + gtk_box_pack_start (GTK_BOX (actionbox), widget, FALSE, FALSE, 0); - col++; //widget = gtk_button_new_with_mnemonic (_("Reset _filters")); //widget = gtk_button_new_with_mnemonic (_("_Reset")); widget = make_image_button(ICONNAME_HB_CLEAR, _("Clear filter")); data->BT_reset = widget; - gtk_grid_attach (GTK_GRID(table), widget, col, 0, 1, 1); + gtk_box_pack_start (GTK_BOX (actionbox), widget, FALSE, FALSE, 0); - col++; widget = make_image_button(ICONNAME_HB_REFRESH, _("Refresh results")); data->BT_refresh = widget; - gtk_grid_attach (GTK_GRID(table), widget, col, 0, 1, 1); + gtk_box_pack_start (GTK_BOX (actionbox), widget, FALSE, FALSE, 0); - col++; widget = make_image_toggle_button(ICONNAME_HB_LIFEENERGY, _("Toggle Life Energy")); data->BT_lifnrg = widget; - gtk_grid_attach (GTK_GRID(table), widget, col, 0, 1, 1); + gtk_box_pack_start (GTK_BOX (actionbox), widget, FALSE, FALSE, 0); - col++; //TRANSLATORS: this is for Euro specific users, a toggle to display in 'Minor' currency widget = gtk_check_button_new_with_mnemonic (_("Euro _minor")); data->CM_minor = widget; - gtk_grid_attach (GTK_GRID(table), widget, col, 0, 1, 1); - - // account name (+ balance) - col++; - //space - label = gtk_label_new(NULL); - gtk_widget_set_hexpand (label, TRUE); - gtk_grid_attach (GTK_GRID(table), label, col, 0, 1, 1); + gtk_box_pack_start (GTK_BOX (actionbox), widget, FALSE, FALSE, 0); - //test menubutton /* widget = gtk_menu_button_new(); @@ -3338,13 +3334,13 @@ gtk_grid_attach (GTK_GRID(table), widget, col, 0, 1, 1); */ - col++; //quick search widget = make_search (); data->ST_search = widget; gtk_widget_set_size_request(widget, HB_MINWIDTH_SEARCH, -1); gtk_widget_set_halign(widget, GTK_ALIGN_END); - gtk_grid_attach (GTK_GRID(table), widget, col, 0, 1, 1); + gtk_box_pack_start (GTK_BOX (actionbox), widget, FALSE, FALSE, 0); + /* grid line 2 */ @@ -3367,6 +3363,7 @@ col++; // text total/selection label = make_label(NULL, 0.0, 0.5); + gtk_label_set_ellipsize(GTK_LABEL(label), PANGO_ELLIPSIZE_END); //#1930395 text selectable for copy/paste gtk_label_set_selectable(GTK_LABEL(label), TRUE); //gtk_widget_set_halign (label, GTK_ALIGN_START); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/homebank-5.8.3/src/hb-account.c new/homebank-5.8.5/src/hb-account.c --- old/homebank-5.8.3/src/hb-account.c 2024-09-04 12:54:48.000000000 +0200 +++ new/homebank-5.8.5/src/hb-account.c 2024-09-29 09:04:34.000000000 +0200 @@ -582,7 +582,8 @@ { existitem = da_acc_get_by_name(stripname); - if( existitem != NULL ) + //#2083124 enable case renaming + if( existitem != NULL && existitem->key != item->key ) { DB( g_print("- error, same name already exist with other key %d <> %d\n", existitem->key, item->key) ); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/homebank-5.8.3/src/hb-category.c new/homebank-5.8.5/src/hb-category.c --- old/homebank-5.8.3/src/hb-category.c 2024-04-29 16:16:26.000000000 +0200 +++ new/homebank-5.8.5/src/hb-category.c 2024-10-02 14:17:41.000000000 +0200 @@ -843,28 +843,28 @@ lnk_txn = g_queue_peek_head_link(acc->txn_queue); while (lnk_txn != NULL) { - Transaction *txn = lnk_txn->data; + Transaction *txnitem = lnk_txn->data; //#1875070 //if(txn->kcat == srckey) - if( category_move_match(txn->kcat, srckey, dosubcat) ) + if( category_move_match(txnitem->kcat, srckey, dosubcat) ) { - txn->kcat = newkey; - txn->flags |= OF_CHANGED; + txnitem->kcat = newkey; + txnitem->flags |= OF_CHANGED; } // move split category #1340142 - nbsplit = da_splits_length(txn->splits); + nbsplit = da_splits_length(txnitem->splits); for(i=0;i<nbsplit;i++) { - Split *split = da_splits_get(txn->splits, i); + Split *split = da_splits_get(txnitem->splits, i); //#1875070 //if( split->kcat == srckey ) if( category_move_match(split->kcat, srckey, dosubcat) ) { split->kcat = newkey; - txn->flags |= OF_CHANGED; + txnitem->flags |= OF_CHANGED; } } @@ -879,14 +879,31 @@ list = g_list_first(GLOBALS->arc_list); while (list != NULL) { - Archive *entry = list->data; + Archive *arcitem = list->data; //#1875070 //if(entry->kcat == srckey) - if( category_move_match(entry->kcat, srckey, dosubcat) ) + if( category_move_match(arcitem->kcat, srckey, dosubcat) ) { - entry->kcat = newkey; + arcitem->kcat = newkey; + arcitem->flags |= OF_CHANGED; } + + //#2081379 handle split as well + nbsplit = da_splits_length(arcitem->splits); + for(i=0;i<nbsplit;i++) + { + Split *split = da_splits_get(arcitem->splits, i); + + //#1875070 + //if( split->kcat == srckey ) + if( category_move_match(split->kcat, srckey, dosubcat) ) + { + split->kcat = newkey; + arcitem->flags |= OF_CHANGED; + } + } + list = g_list_next(list); } @@ -894,11 +911,11 @@ lpay = list = g_hash_table_get_values(GLOBALS->h_pay); while (list != NULL) { - Payee *entry = list->data; + Payee *payitem = list->data; - if( category_move_match(entry->kcat, srckey, dosubcat) ) + if( category_move_match(payitem->kcat, srckey, dosubcat) ) { - entry->kcat = newkey; + payitem->kcat = newkey; } list = g_list_next(list); } @@ -908,13 +925,13 @@ lrul = list = g_hash_table_get_values(GLOBALS->h_rul); while (list != NULL) { - Assign *entry = list->data; + Assign *asgitem = list->data; //#1875070 //if(entry->kcat == srckey) - if( category_move_match(entry->kcat, srckey, dosubcat) ) + if( category_move_match(asgitem->kcat, srckey, dosubcat) ) { - entry->kcat = newkey; + asgitem->kcat = newkey; } list = g_list_next(list); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/homebank-5.8.3/src/homebank.c new/homebank-5.8.5/src/homebank.c --- old/homebank-5.8.3/src/homebank.c 2024-08-14 23:26:52.000000000 +0200 +++ new/homebank-5.8.5/src/homebank.c 2024-10-04 08:55:24.000000000 +0200 @@ -1110,15 +1110,32 @@ } +//#2080864 handle version static gint -homebank_app_commandline(GApplication *application, GApplicationCommandLine *cl, gpointer user_data) +homebank_app_handle_local_options (GApplication *application, + GVariantDict *options) +{ + if (g_variant_dict_contains (options, "version")) + { + g_print ("%s - Version %s\n", g_get_application_name (), VERSION); + return 0; + } + + + return -1; +} + + +static gint +homebank_app_commandline(GApplication *application, GApplicationCommandLine *cmdline, gpointer user_data) { GVariantDict *options; gchar **remaining_args; DB( g_print("\n[homebank] app commandline\n") ); - options = g_application_command_line_get_options_dict (cl); + + options = g_application_command_line_get_options_dict (cmdline); /* Parse filenames */ if (g_variant_dict_lookup (options, G_OPTION_REMAINING, "^a&ay", &remaining_args)) @@ -1325,6 +1342,7 @@ g_signal_connect (app, "startup" , G_CALLBACK (homebank_app_startup) , NULL); g_signal_connect (app, "command-line" , G_CALLBACK (homebank_app_commandline) , NULL); + g_signal_connect (app, "handle-local-options" , G_CALLBACK (homebank_app_handle_local_options) , NULL); g_signal_connect (app, "activate" , G_CALLBACK (homebank_app_activate) , NULL); g_signal_connect (app, "open" , G_CALLBACK (homebank_app_open) , NULL); g_signal_connect (app, "shutdown" , G_CALLBACK (homebank_app_shutdown) , NULL); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/homebank-5.8.3/src/homebank.h new/homebank-5.8.5/src/homebank.h --- old/homebank-5.8.3/src/homebank.h 2024-08-14 23:26:11.000000000 +0200 +++ new/homebank-5.8.5/src/homebank.h 2024-10-05 08:55:32.000000000 +0200 @@ -81,13 +81,13 @@ #define HOMEBANK_MAJOR 5 #define HOMEBANK_MINOR 8 -#define HOMEBANK_MICRO 3 +#define HOMEBANK_MICRO 5 -#define HB_VERSION "5.8.3" +#define HB_VERSION "5.8.5" #define HB_VERSION_NUM (HOMEBANK_MAJOR*10000) + (HOMEBANK_MINOR*100) + HOMEBANK_MICRO #define FILE_VERSION 1.5 -#define PREF_VERSION 583 +#define PREF_VERSION 585 #if HB_UNSTABLE == FALSE #define PROGNAME "HomeBank" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/homebank-5.8.3/src/list-account.c new/homebank-5.8.5/src/list-account.c --- old/homebank-5.8.3/src/list-account.c 2024-05-11 12:03:01.000000000 +0200 +++ new/homebank-5.8.5/src/list-account.c 2024-10-04 08:57:52.000000000 +0200 @@ -41,14 +41,17 @@ -static void lst_accview_to_string_row(GString *node, ToStringMode mode, GtkTreeModel *model, GtkTreeIter *iter, gchar *sub) +static void lst_accview_to_string_row(GString *node, ToStringMode mode, GtkTreeModel *model, GtkTreeIter *iter, gchar *sub, gint flags) { -const gchar *format; gpointer p; gint type; gchar *text = ""; +gchar sep; gdouble clear, recon, today, future; guint32 kcur = GLOBALS->kcur; +gchar buf[G_ASCII_DTOSTR_BUF_SIZE]; + + sep = (mode == HB_STRING_EXPORT) ? ';' : '\t'; clear = recon = today = future = 0.0; @@ -61,7 +64,7 @@ { PnlAccGrp *g = p; text = g->name; - g_string_append_printf(node, "%s\t\t\t\t\n", text); + g_string_append_printf(node, "%s\n", text); } else { @@ -90,29 +93,37 @@ if( type == DSPACC_TYPE_TOTAL ) text = _("Grand total"); - if( mode != HB_STRING_PRINT ) - { - format = (mode == HB_STRING_CLIPBOARD) ? "%s%s\t%.2f\t%.2f\t%.2f\t%.2f\n" : "%s%s;%.2f;%.2f;%.2f;%.2f\n"; - g_string_append_printf(node, format, sub, text, recon, clear, today, future); - } - else - { - gchar buf[G_ASCII_DTOSTR_BUF_SIZE]; + g_string_append_printf(node, "%s%s", sub, text); - g_string_append_printf(node, "%s%s\t", sub, text); + if( flags & LST_TXN_ACC_REC ) + { hb_strfmon(buf, G_ASCII_DTOSTR_BUF_SIZE-1, recon, kcur, FALSE); + g_string_append_c(node, sep); g_string_append(node, buf); - g_string_append_c(node, '\t'); + } + + if( flags & LST_TXN_ACC_CLR ) + { hb_strfmon(buf, G_ASCII_DTOSTR_BUF_SIZE-1, clear, kcur, FALSE); + g_string_append_c(node, sep); g_string_append(node, buf); - g_string_append_c(node, '\t'); + } + + if( flags & LST_TXN_ACC_TOD ) + { hb_strfmon(buf, G_ASCII_DTOSTR_BUF_SIZE-1, today, kcur, FALSE); + g_string_append_c(node, sep); g_string_append(node, buf); - g_string_append_c(node, '\t'); + } + + if( flags & LST_TXN_ACC_FUT ) + { hb_strfmon(buf, G_ASCII_DTOSTR_BUF_SIZE-1, future, kcur, FALSE); + g_string_append_c(node, sep); g_string_append(node, buf); - g_string_append(node, "\n"); } + + g_string_append(node, "\n"); } } @@ -124,6 +135,7 @@ GtkTreeIter iter, child; gboolean valid; guint32 nbcols, i; +gint uid, flags = 0; gchar sep; DB( g_print("\n[lst_accview] to string\n") ); @@ -141,29 +153,42 @@ //todo: ? restrict to visibility if( GTK_IS_TREE_VIEW_COLUMN(column) ) { - g_string_append(node, gtk_tree_view_column_get_title (column)); - if( i < nbcols-1 ) + if( gtk_tree_view_column_get_visible(column)) { - g_string_append_c(node, sep); + uid = GPOINTER_TO_UINT(g_object_get_data(G_OBJECT(column), "uid")); + switch(uid) + { + case COL_DSPACC_RECON : flags |= LST_TXN_ACC_REC; break; + case COL_DSPACC_CLEAR : flags |= LST_TXN_ACC_CLR; break; + case COL_DSPACC_TODAY : flags |= LST_TXN_ACC_TOD; break; + case COL_DSPACC_FUTURE: flags |= LST_TXN_ACC_FUT; break; + } + + g_string_append(node, gtk_tree_view_column_get_title (column)); + if( i < nbcols-1 ) + { + g_string_append_c(node, sep); + } } } } g_string_append_c(node, '\n'); - //lines model = gtk_tree_view_get_model(treeview); valid = gtk_tree_model_get_iter_first(GTK_TREE_MODEL(model), &iter); while (valid) { - lst_accview_to_string_row(node, mode, model, &iter, ""); + lst_accview_to_string_row(node, mode, model, &iter, "", flags); + if( gtk_tree_model_iter_has_child(model, &iter) ) { valid = gtk_tree_model_iter_children(model, &child, &iter); while (valid) { - lst_accview_to_string_row(node, mode, model, &child, "- "); + lst_accview_to_string_row(node, mode, model, &child, "- ", flags); + valid = gtk_tree_model_iter_next(GTK_TREE_MODEL(model), &child); } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/homebank-5.8.3/src/list-account.h new/homebank-5.8.5/src/list-account.h --- old/homebank-5.8.3/src/list-account.h 2024-04-01 19:13:16.000000000 +0200 +++ new/homebank-5.8.5/src/list-account.h 2024-10-03 09:22:28.000000000 +0200 @@ -60,6 +60,14 @@ }; +enum { + LST_TXN_ACC_REC = 1 << 0, //detail/print + LST_TXN_ACC_CLR = 1 << 1, //!print + LST_TXN_ACC_TOD = 1 << 2, + LST_TXN_ACC_FUT = 1 << 3, +}; + + struct lst_accview_data { GtkWidget *treeview; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/homebank-5.8.3/src/ui-account.c new/homebank-5.8.5/src/ui-account.c --- old/homebank-5.8.3/src/ui-account.c 2024-08-07 18:40:06.000000000 +0200 +++ new/homebank-5.8.5/src/ui-account.c 2024-09-29 09:05:55.000000000 +0200 @@ -1491,7 +1491,6 @@ struct ui_acc_manage_data *data; Account *item; guint32 key; -gboolean valid; data = g_object_get_data(G_OBJECT(gtk_widget_get_ancestor(widget, GTK_TYPE_WINDOW)), "inst_data"); DB( g_print("\n(ui_acc_manage_rename) data=%p\n", data) ); @@ -1504,7 +1503,12 @@ gchar *name = dialog_get_name(_("Account name"), item->name, GTK_WINDOW(data->dialog)); if(name != NULL) { - if(account_exists(name)) + if(account_rename(item, name)) + { + gtk_tree_view_columns_autosize (GTK_TREE_VIEW(data->LV_acc)); + data->change++; + } + else { ui_dialog_msg_infoerror(GTK_WINDOW(data->dialog), GTK_MESSAGE_ERROR, _("Error"), @@ -1515,18 +1519,7 @@ name ); } - else - { - valid = account_rename(item, name); - if(valid) - { - gtk_tree_view_columns_autosize (GTK_TREE_VIEW(data->LV_acc)); - data->change++; - } - } - } - } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/homebank-5.8.3/src/ui-budget-tabview.c new/homebank-5.8.5/src/ui-budget-tabview.c --- old/homebank-5.8.3/src/ui-budget-tabview.c 2024-08-04 21:53:46.000000000 +0200 +++ new/homebank-5.8.5/src/ui-budget-tabview.c 2024-10-04 09:29:23.000000000 +0200 @@ -125,6 +125,8 @@ UI_BUD_TABVIEW_IS_SAME_AMOUNT, UI_BUD_TABVIEW_IS_SUB_CATEGORY, UI_BUD_TABVIEW_HAS_BUDGET, + + UI_BUD_TABVIEW_TOTAL, UI_BUD_TABVIEW_SAME_AMOUNT, UI_BUD_TABVIEW_JANUARY, UI_BUD_TABVIEW_FEBRUARY, @@ -302,7 +304,7 @@ { if (parent_search.iterator) { - DB(g_print("\tRecursion optimisation: parent key %d already exists\n", parent_search.row_category_key)); + DB(g_print(" Recursion optimisation: parent key %d already exists\n", parent_search.row_category_key)); // If parent already exists, stop recursion parent = parent_search.iterator; } @@ -326,8 +328,7 @@ -1); } - DB(g_print("insert new category %s (key: %d, type: %d)\n", - bdg_category->name, bdg_category->key, category_type_get (bdg_category))); + DB(g_print(" >insert '%s'\n", bdg_category->fullname)); gtk_tree_store_set( budget, @@ -542,61 +543,131 @@ return; } -// Update (or insert) total rows for a budget according to the view mode -// This function will is used to initiate model and to refresh it after change by user -static void ui_bud_tabview_model_update_monthly_total(GtkTreeStore* budget) -{ -ui_bud_tabview_search_criteria_t root_search = ui_bud_tabview_search_criteria_default; -GtkTreeIter total_root, child; -double total_income[12] = {0}, total_expense[12] = {0}; -gboolean cat_is_same_amount; -guint32 n_category; - // Go through all categories to compute totals - n_category = da_cat_get_max_key(); +static gdouble test_sum(Category *catitem, gdouble *total_tab) +{ +gdouble totalcat = 0.0; - for(guint32 i=1; i<=n_category; ++i) + for(gint j=1;j<=12;j++) { - Category *bdg_category; - gboolean cat_is_income; - - bdg_category = da_cat_get(i); - - if (bdg_category == NULL) + if(!(catitem->flags & GF_CUSTOM)) { - continue; + total_tab[j] += catitem->budget[0]; + totalcat += catitem->budget[0]; + } + else + { + total_tab[j] += catitem->budget[j]; + totalcat += catitem->budget[j]; } + } + total_tab[0] += totalcat; + return totalcat; +} - cat_is_income = (category_type_get (bdg_category) == 1); - cat_is_same_amount = (! (bdg_category->flags & GF_CUSTOM)); - for (gint j=0; j<=11; ++j) + +static void test_total_sum(GtkTreeStore *budget, GtkTreeIter *root, gdouble *total_tab) +{ +GtkTreeIter iter, child; +gboolean valid, cvalid, cheader, sep; +guint32 key, ckey; + + //valid = gtk_tree_model_get_iter_first(GTK_TREE_MODEL(budget), &iter); + valid = gtk_tree_model_iter_children (GTK_TREE_MODEL(budget), &iter, root); + while (valid) + { + Category *catitem; + + gtk_tree_model_get(GTK_TREE_MODEL(budget), &iter, + UI_BUD_TABVIEW_CATEGORY_KEY, &key, + UI_BUD_TABVIEW_IS_CHILD_HEADER, &cheader, + UI_BUD_TABVIEW_IS_SEPARATOR, &sep, + -1); + + if( cheader == FALSE && sep == FALSE ) { - if (cat_is_income) - { - if (cat_is_same_amount) - { - total_income[j] += bdg_category->budget[0]; - } - else - { - total_income[j] += bdg_category->budget[j+1]; - } - } - else + gdouble tmpsum = 0.0; + + catitem = da_cat_get(key); + DB( g_print(" iter: %d %s\n", key, catitem->name) ); + tmpsum += test_sum(catitem, total_tab); + + // children ? + cvalid = gtk_tree_model_iter_children (GTK_TREE_MODEL(budget), &child, &iter); + while (cvalid) { - if (cat_is_same_amount) - { - total_expense[j] += bdg_category->budget[0]; - } - else + gtk_tree_model_get(GTK_TREE_MODEL(budget), &child, + UI_BUD_TABVIEW_CATEGORY_KEY, &ckey, + UI_BUD_TABVIEW_IS_CHILD_HEADER, &cheader, + UI_BUD_TABVIEW_IS_SEPARATOR, &sep, + -1); + + if( cheader == FALSE && sep == FALSE ) { - total_expense[j] += bdg_category->budget[j+1]; + gdouble cbudget; + + catitem = da_cat_get(ckey); + DB( g_print(" child: %d %s\n", ckey, catitem->name) ); + cbudget = test_sum(catitem, total_tab); + + tmpsum += cbudget; + gtk_tree_store_set ( + budget, + &child, + UI_BUD_TABVIEW_TOTAL, cbudget, + -1); + } + + cvalid = gtk_tree_model_iter_next(GTK_TREE_MODEL(budget), &child); } + + gtk_tree_store_set ( + budget, + &iter, + UI_BUD_TABVIEW_TOTAL, tmpsum, + -1); + } + + valid = gtk_tree_model_iter_next(GTK_TREE_MODEL(budget), &iter); } + +} + + + +// Update (or insert) total rows for a budget according to the view mode +// This function will is used to initiate model and to refresh it after change by user +static void ui_bud_tabview_model_update_monthly_total(GtkTreeStore* budget) +{ +ui_bud_tabview_search_criteria_t root_search = ui_bud_tabview_search_criteria_default; +GtkTreeIter total_root, child; +double total_income[13] = {0}, total_expense[13] = {0}; + + // Retrieve required root + root_search.row_is_root = TRUE; + root_search.row_is_total = FALSE; + + //#2036404 compute total + root_search.row_category_type = UI_BUD_TABVIEW_CAT_TYPE_INCOME; + gtk_tree_model_foreach(GTK_TREE_MODEL(budget), + (GtkTreeModelForeachFunc) ui_bud_tabview_model_search_iterator, + &root_search); + + test_total_sum(budget, root_search.iterator, total_income); + + //#2036404 compute total + root_search.row_category_type = UI_BUD_TABVIEW_CAT_TYPE_EXPENSE; + gtk_tree_model_foreach(GTK_TREE_MODEL(budget), + (GtkTreeModelForeachFunc) ui_bud_tabview_model_search_iterator, + &root_search); + + test_total_sum(budget, root_search.iterator, total_expense); + + // Retrieve total root and insert required total rows root_search.row_is_root = TRUE; root_search.row_is_total = FALSE; @@ -639,18 +710,19 @@ UI_BUD_TABVIEW_CATEGORY_FULLNAME, _(UI_BUD_TABVIEW_VIEW_MODE[UI_BUD_TABVIEW_VIEW_INCOME]), UI_BUD_TABVIEW_CATEGORY_TYPE, UI_BUD_TABVIEW_CAT_TYPE_INCOME, UI_BUD_TABVIEW_IS_TOTAL, TRUE, - UI_BUD_TABVIEW_JANUARY, total_income[0], - UI_BUD_TABVIEW_FEBRUARY, total_income[1], - UI_BUD_TABVIEW_MARCH, total_income[2], - UI_BUD_TABVIEW_APRIL, total_income[3], - UI_BUD_TABVIEW_MAY, total_income[4], - UI_BUD_TABVIEW_JUNE, total_income[5], - UI_BUD_TABVIEW_JULY, total_income[6], - UI_BUD_TABVIEW_AUGUST, total_income[7], - UI_BUD_TABVIEW_SEPTEMBER, total_income[8], - UI_BUD_TABVIEW_OCTOBER, total_income[9], - UI_BUD_TABVIEW_NOVEMBER, total_income[10], - UI_BUD_TABVIEW_DECEMBER, total_income[11], + UI_BUD_TABVIEW_TOTAL, total_income[0], + UI_BUD_TABVIEW_JANUARY, total_income[1], + UI_BUD_TABVIEW_FEBRUARY, total_income[2], + UI_BUD_TABVIEW_MARCH, total_income[3], + UI_BUD_TABVIEW_APRIL, total_income[4], + UI_BUD_TABVIEW_MAY, total_income[5], + UI_BUD_TABVIEW_JUNE, total_income[6], + UI_BUD_TABVIEW_JULY, total_income[7], + UI_BUD_TABVIEW_AUGUST, total_income[8], + UI_BUD_TABVIEW_SEPTEMBER, total_income[9], + UI_BUD_TABVIEW_OCTOBER, total_income[10], + UI_BUD_TABVIEW_NOVEMBER, total_income[11], + UI_BUD_TABVIEW_DECEMBER, total_income[12], -1); // Then look for Expenses @@ -676,18 +748,19 @@ UI_BUD_TABVIEW_CATEGORY_FULLNAME, _(UI_BUD_TABVIEW_VIEW_MODE[UI_BUD_TABVIEW_VIEW_EXPENSE]), UI_BUD_TABVIEW_CATEGORY_TYPE, UI_BUD_TABVIEW_CAT_TYPE_EXPENSE, UI_BUD_TABVIEW_IS_TOTAL, TRUE, - UI_BUD_TABVIEW_JANUARY, total_expense[0], - UI_BUD_TABVIEW_FEBRUARY, total_expense[1], - UI_BUD_TABVIEW_MARCH, total_expense[2], - UI_BUD_TABVIEW_APRIL, total_expense[3], - UI_BUD_TABVIEW_MAY, total_expense[4], - UI_BUD_TABVIEW_JUNE, total_expense[5], - UI_BUD_TABVIEW_JULY, total_expense[6], - UI_BUD_TABVIEW_AUGUST, total_expense[7], - UI_BUD_TABVIEW_SEPTEMBER, total_expense[8], - UI_BUD_TABVIEW_OCTOBER, total_expense[9], - UI_BUD_TABVIEW_NOVEMBER, total_expense[10], - UI_BUD_TABVIEW_DECEMBER, total_expense[11], + UI_BUD_TABVIEW_TOTAL, total_expense[0], + UI_BUD_TABVIEW_JANUARY, total_expense[1], + UI_BUD_TABVIEW_FEBRUARY, total_expense[2], + UI_BUD_TABVIEW_MARCH, total_expense[3], + UI_BUD_TABVIEW_APRIL, total_expense[4], + UI_BUD_TABVIEW_MAY, total_expense[5], + UI_BUD_TABVIEW_JUNE, total_expense[6], + UI_BUD_TABVIEW_JULY, total_expense[7], + UI_BUD_TABVIEW_AUGUST, total_expense[8], + UI_BUD_TABVIEW_SEPTEMBER, total_expense[9], + UI_BUD_TABVIEW_OCTOBER, total_expense[10], + UI_BUD_TABVIEW_NOVEMBER, total_expense[11], + UI_BUD_TABVIEW_DECEMBER, total_expense[12], -1); // Finally, set Balance total row @@ -713,18 +786,19 @@ UI_BUD_TABVIEW_CATEGORY_FULLNAME, _(UI_BUD_TABVIEW_VIEW_MODE[UI_BUD_TABVIEW_VIEW_SUMMARY]), UI_BUD_TABVIEW_CATEGORY_TYPE, UI_BUD_TABVIEW_CAT_TYPE_NONE, UI_BUD_TABVIEW_IS_TOTAL, TRUE, - UI_BUD_TABVIEW_JANUARY, total_income[0] + total_expense[0], - UI_BUD_TABVIEW_FEBRUARY, total_income[1] + total_expense[1], - UI_BUD_TABVIEW_MARCH, total_income[2] + total_expense[2], - UI_BUD_TABVIEW_APRIL, total_income[3] + total_expense[3], - UI_BUD_TABVIEW_MAY, total_income[4] + total_expense[4], - UI_BUD_TABVIEW_JUNE, total_income[5] + total_expense[5], - UI_BUD_TABVIEW_JULY, total_income[6] + total_expense[6], - UI_BUD_TABVIEW_AUGUST, total_income[7] + total_expense[7], - UI_BUD_TABVIEW_SEPTEMBER, total_income[8] + total_expense[8], - UI_BUD_TABVIEW_OCTOBER, total_income[9] + total_expense[9], - UI_BUD_TABVIEW_NOVEMBER, total_income[10] + total_expense[10], - UI_BUD_TABVIEW_DECEMBER, total_income[11] + total_expense[11], + UI_BUD_TABVIEW_TOTAL, total_income[0] + total_expense[0], + UI_BUD_TABVIEW_JANUARY, total_income[1] + total_expense[1], + UI_BUD_TABVIEW_FEBRUARY, total_income[2] + total_expense[2], + UI_BUD_TABVIEW_MARCH, total_income[3] + total_expense[3], + UI_BUD_TABVIEW_APRIL, total_income[4] + total_expense[4], + UI_BUD_TABVIEW_MAY, total_income[5] + total_expense[5], + UI_BUD_TABVIEW_JUNE, total_income[6] + total_expense[6], + UI_BUD_TABVIEW_JULY, total_income[7] + total_expense[7], + UI_BUD_TABVIEW_AUGUST, total_income[8] + total_expense[8], + UI_BUD_TABVIEW_SEPTEMBER, total_income[9] + total_expense[9], + UI_BUD_TABVIEW_OCTOBER, total_income[10] + total_expense[10], + UI_BUD_TABVIEW_NOVEMBER, total_income[11] + total_expense[11], + UI_BUD_TABVIEW_DECEMBER, total_income[12] + total_expense[12], -1); g_free(root_search.iterator); @@ -1048,44 +1122,14 @@ return order; } -// the budget model creation -static GtkTreeModel * ui_bud_tabview_model_new () + +static void ui_bud_tabview_model_populate (GtkTreeStore *budget) { -GtkTreeStore *budget; GtkTreeIter *iter_income, *iter_expense; guint32 n_category; ui_bud_tabview_search_criteria_t root_search = ui_bud_tabview_search_criteria_default; - // Create Tree Store - budget = gtk_tree_store_new ( UI_BUD_TABVIEW_NUMBER_COLOMNS, - G_TYPE_UINT, // UI_BUD_TABVIEW_CATEGORY_KEY - G_TYPE_STRING, // UI_BUD_TABVIEW_CATEGORY_NAME - G_TYPE_STRING, // UI_BUD_TABVIEW_CATEGORY_FULLNAME - G_TYPE_INT, // UI_BUD_TABVIEW_CATEGORY_TYPE - G_TYPE_BOOLEAN, // UI_BUD_TABVIEW_IS_ROOT - G_TYPE_BOOLEAN, // UI_BUD_TABVIEW_IS_TOTAL - G_TYPE_BOOLEAN, // UI_BUD_TABVIEW_IS_CHILD_HEADER - G_TYPE_BOOLEAN, // UI_BUD_TABVIEW_IS_SEPARATOR - G_TYPE_BOOLEAN, // UI_BUD_TABVIEW_IS_MONITORING_FORCED - G_TYPE_BOOLEAN, // UI_BUD_TABVIEW_IS_SAME_AMOUNT - G_TYPE_BOOLEAN, // UI_BUD_TABVIEW_IS_SUB_CATEGORY - G_TYPE_BOOLEAN, // UI_BUD_TABVIEW_HAS_BUDGET - G_TYPE_DOUBLE, // UI_BUD_TABVIEW_SAME_AMOUNT - G_TYPE_DOUBLE, // UI_BUD_TABVIEW_JANUARY - G_TYPE_DOUBLE, // UI_BUD_TABVIEW_FEBRUARY - G_TYPE_DOUBLE, // UI_BUD_TABVIEW_MARCH - G_TYPE_DOUBLE, // UI_BUD_TABVIEW_APRIL - G_TYPE_DOUBLE, // UI_BUD_TABVIEW_MAY - G_TYPE_DOUBLE, // UI_BUD_TABVIEW_JUNE - G_TYPE_DOUBLE, // UI_BUD_TABVIEW_JULY - G_TYPE_DOUBLE, // UI_BUD_TABVIEW_AUGUST - G_TYPE_DOUBLE, // UI_BUD_TABVIEW_SEPTEMBER - G_TYPE_DOUBLE, // UI_BUD_TABVIEW_OCTOBER - G_TYPE_DOUBLE, // UI_BUD_TABVIEW_NOVEMBER - G_TYPE_DOUBLE // UI_BUD_TABVIEW_DECEMBER - ); - - // Populate the store + DB( g_print("\n[ui-budget] model populate\n") ) /* Create tree roots */ ui_bud_tabview_model_insert_roots (budget); @@ -1142,6 +1186,48 @@ /* Create rows for total root */ ui_bud_tabview_model_update_monthly_total(GTK_TREE_STORE(budget)); + g_free(root_search.iterator); +} + + +// the budget model creation +static GtkTreeModel * ui_bud_tabview_model_new () +{ +GtkTreeStore *budget; + + // Create Tree Store + budget = gtk_tree_store_new ( UI_BUD_TABVIEW_NUMBER_COLOMNS, + G_TYPE_UINT, // UI_BUD_TABVIEW_CATEGORY_KEY + G_TYPE_STRING, // UI_BUD_TABVIEW_CATEGORY_NAME + G_TYPE_STRING, // UI_BUD_TABVIEW_CATEGORY_FULLNAME + G_TYPE_INT, // UI_BUD_TABVIEW_CATEGORY_TYPE + G_TYPE_BOOLEAN, // UI_BUD_TABVIEW_IS_ROOT + G_TYPE_BOOLEAN, // UI_BUD_TABVIEW_IS_TOTAL + G_TYPE_BOOLEAN, // UI_BUD_TABVIEW_IS_CHILD_HEADER + G_TYPE_BOOLEAN, // UI_BUD_TABVIEW_IS_SEPARATOR + G_TYPE_BOOLEAN, // UI_BUD_TABVIEW_IS_MONITORING_FORCED + G_TYPE_BOOLEAN, // UI_BUD_TABVIEW_IS_SAME_AMOUNT + G_TYPE_BOOLEAN, // UI_BUD_TABVIEW_IS_SUB_CATEGORY + G_TYPE_BOOLEAN, // UI_BUD_TABVIEW_HAS_BUDGET + G_TYPE_DOUBLE, // UI_BUD_TABVIEW_TOTAL + G_TYPE_DOUBLE, // UI_BUD_TABVIEW_SAME_AMOUNT + G_TYPE_DOUBLE, // UI_BUD_TABVIEW_JANUARY + G_TYPE_DOUBLE, // UI_BUD_TABVIEW_FEBRUARY + G_TYPE_DOUBLE, // UI_BUD_TABVIEW_MARCH + G_TYPE_DOUBLE, // UI_BUD_TABVIEW_APRIL + G_TYPE_DOUBLE, // UI_BUD_TABVIEW_MAY + G_TYPE_DOUBLE, // UI_BUD_TABVIEW_JUNE + G_TYPE_DOUBLE, // UI_BUD_TABVIEW_JULY + G_TYPE_DOUBLE, // UI_BUD_TABVIEW_AUGUST + G_TYPE_DOUBLE, // UI_BUD_TABVIEW_SEPTEMBER + G_TYPE_DOUBLE, // UI_BUD_TABVIEW_OCTOBER + G_TYPE_DOUBLE, // UI_BUD_TABVIEW_NOVEMBER + G_TYPE_DOUBLE // UI_BUD_TABVIEW_DECEMBER + ); + + // Populate the store + ui_bud_tabview_model_populate(budget); + /* Sort categories on same node level */ gtk_tree_sortable_set_sort_func (GTK_TREE_SORTABLE(budget), UI_BUD_TABVIEW_CATEGORY_NAME, ui_bud_tabview_model_row_sort, @@ -1149,18 +1235,16 @@ gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (budget), UI_BUD_TABVIEW_CATEGORY_NAME, GTK_SORT_ASCENDING); - g_free(root_search.iterator); - return GTK_TREE_MODEL(budget); } + /** * GtkTreeView functions **/ - static void ui_bud_tabview_icon_cell_data_function (GtkTreeViewColumn *col, GtkCellRenderer *renderer, GtkTreeModel *model, GtkTreeIter *iter, gpointer user_data) { -ui_bud_tabview_data_t *data = user_data; +//ui_bud_tabview_data_t *data = user_data; gchar *iconname = NULL; gboolean has_budget, is_monitoring_forced; ui_bud_tabview_view_mode_t view_mode = UI_BUD_TABVIEW_VIEW_SUMMARY; @@ -1170,7 +1254,7 @@ UI_BUD_TABVIEW_HAS_BUDGET, &has_budget, -1); - view_mode = hbtk_switcher_get_active (HBTK_SWITCHER(data->RA_mode)); + //view_mode = hbtk_switcher_get_active (HBTK_SWITCHER(data->RA_mode)); //5.3 added if( is_monitoring_forced ) @@ -1190,19 +1274,20 @@ // Display category name in bold if it has budget static void ui_bud_tabview_view_display_category_name (GtkTreeViewColumn *col, GtkCellRenderer *renderer, GtkTreeModel *model, GtkTreeIter *iter, gpointer user_data) { -ui_bud_tabview_data_t *data = user_data; +//ui_bud_tabview_data_t *data = user_data; gboolean has_budget, is_sub_category; PangoWeight weight = PANGO_WEIGHT_NORMAL; -ui_bud_tabview_view_mode_t view_mode = UI_BUD_TABVIEW_VIEW_SUMMARY; +//ui_bud_tabview_view_mode_t view_mode = UI_BUD_TABVIEW_VIEW_SUMMARY; gtk_tree_model_get(model, iter, UI_BUD_TABVIEW_IS_SUB_CATEGORY, &is_sub_category, UI_BUD_TABVIEW_HAS_BUDGET, &has_budget, -1); - view_mode = hbtk_switcher_get_active (HBTK_SWITCHER(data->RA_mode)); + //view_mode = hbtk_switcher_get_active (HBTK_SWITCHER(data->RA_mode)); - if (view_mode != UI_BUD_TABVIEW_VIEW_SUMMARY && has_budget) + //if (view_mode != UI_BUD_TABVIEW_VIEW_SUMMARY && has_budget) + if (has_budget) { weight = PANGO_WEIGHT_BOLD; } @@ -1311,7 +1396,7 @@ // to enable or not edition on month columns static void ui_bud_tabview_view_display_is_same_amount (GtkTreeViewColumn *col, GtkCellRenderer *renderer, GtkTreeModel *model, GtkTreeIter *iter, gpointer user_data) { -gboolean is_same_amount, is_root, is_total, is_visible, is_sensitive; +gboolean is_same_amount, is_total, is_root, is_visible, is_sensitive; gtk_tree_model_get(model, iter, UI_BUD_TABVIEW_IS_ROOT, &is_root, @@ -1340,21 +1425,22 @@ // Compute dynamically the annual total static void ui_bud_tabview_view_display_annual_total (GtkTreeViewColumn *col, GtkCellRenderer *renderer, GtkTreeModel *model, GtkTreeIter *iter, gpointer user_data) { -gboolean is_same_amount = FALSE, is_total = FALSE, is_root = FALSE; -gdouble amount = 0.0; -gdouble total = 0.0; +gboolean is_root = FALSE; gchar *text; gchar *fgcolor; gboolean is_visible = TRUE; +gdouble celltotal; + gtk_tree_model_get(model, iter, UI_BUD_TABVIEW_IS_ROOT, &is_root, - UI_BUD_TABVIEW_IS_SAME_AMOUNT, &is_same_amount, - UI_BUD_TABVIEW_SAME_AMOUNT, &amount, - UI_BUD_TABVIEW_IS_TOTAL, &is_total, + //UI_BUD_TABVIEW_IS_SAME_AMOUNT, &is_same_amount, + //UI_BUD_TABVIEW_SAME_AMOUNT, &amount, + //UI_BUD_TABVIEW_IS_TOTAL, &is_total, + UI_BUD_TABVIEW_TOTAL, &celltotal, -1); - if (is_same_amount) + /*if (is_same_amount) { total = 12.0 * amount; } @@ -1367,8 +1453,9 @@ } } - text = g_strdup_printf("%.2f", total); - fgcolor = get_normal_color_amount(total); + text = g_strdup_printf("%.2f // %.2f", total, celltotal);*/ + text = g_strdup_printf("%.2f", celltotal); + fgcolor = get_normal_color_amount(celltotal); if (is_root) { @@ -1377,8 +1464,10 @@ // Finally, visibility depends on set amount //is_visible = (is_visible && amount != 0.0); + //#1859275 visibility to be tested on total - is_visible = (is_visible && total != 0.0); + is_visible = (is_visible && celltotal != 0.0); + g_object_set(renderer, "text", text, @@ -1394,7 +1483,7 @@ static void ui_bud_tabview_view_display_monthly_average(GtkTreeViewColumn *col, GtkCellRenderer *renderer, GtkTreeModel *model, GtkTreeIter *iter, gpointer user_data) { gboolean is_same_amount = FALSE, is_total = FALSE, is_root = FALSE; -gdouble amount = 0.0; +gdouble amount = 0.0, celltotal; gdouble average = 0.0; gchar *text; gchar *fgcolor; @@ -1405,9 +1494,10 @@ UI_BUD_TABVIEW_IS_SAME_AMOUNT, &is_same_amount, UI_BUD_TABVIEW_SAME_AMOUNT, &amount, UI_BUD_TABVIEW_IS_TOTAL, &is_total, + UI_BUD_TABVIEW_TOTAL, &celltotal, -1); - if (is_same_amount) + /*if (is_same_amount) { average = amount; } @@ -1419,7 +1509,9 @@ average += amount; } average = hb_amount_round(average / 12.0, 2); - } + }*/ + + average = hb_amount_round(celltotal / 12.0, 2); text = g_strdup_printf("%.2f", average); fgcolor = get_normal_color_amount(average); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/homebank-5.8.3/src/ui-widgets.c new/homebank-5.8.5/src/ui-widgets.c --- old/homebank-5.8.3/src/ui-widgets.c 2024-05-10 23:42:25.000000000 +0200 +++ new/homebank-5.8.5/src/ui-widgets.c 2024-10-04 09:17:38.000000000 +0200 @@ -1038,7 +1038,8 @@ //gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinner), TRUE); //g_object_set(spinner, "xalign", 1.0, NULL); - //gtk_entry_set_width_chars(spinner, 10); + //#2081574 width too small + gtk_entry_set_width_chars(GTK_ENTRY(spinner), 10); if(label) gtk_label_set_mnemonic_widget (GTK_LABEL(label), spinner);
participants (1)
-
Source-Sync