Commit 8c47830e authored by Maxime Doyen's avatar Maxime Doyen

lots of minor changes, some bugfix

parent ca4e954f
......@@ -23,17 +23,22 @@
* change: homebank, clarified the error load messages
* change: homebank, optimized xml
* change: homebank, added a visual type of category everywhere (-income/+expense)
* change: replaced (none) by something more relevant
* wish : #140504 category split for transaction
* wish : #400010 csv export add support of mm-dd-yy
* wish : #593435 add subtotals for account list by type or bank
* wish : #660450 Cash Account hidden from Accounts Overview
* wish : #688494 limit day for automatic transaction add in the future
* wish : #722226 wish: xhb file format : amounts and order details
* wish : #730137 wish: portable app for ms-windows
* wish : #730319 wish: single click in calendar to choose date
* wish : #787131 Column titles in exported CSV
* wish : #787134 Exporting to CSV should include all available columns
* wish : #833614 sorting on category / subcategory in statistics report
* wish : #856477 improve category dropdown with +/-
* wish : #886372 Poland in the European country list
* wish : #1006802 hide reconciled transactions by default
* wish : #1088259 wish: Handling "VOIDed" check transactions
* bugfix: archive target internal transfer account
* bugfix: closed accounts were not excluded from reports
* bugfix: detail status and rate in toolbar report window was not initialized
......@@ -58,8 +63,12 @@
* bugfix: #885749 QIF Import shows wrong amount
* bugfix: #905277 balance rapport reports wrong amount
* bugfix: #926915 transaction modify window sizing problem
* bugfix: #931187 preferences not saved when ~/.config doesn't exist
* bugfix: #932959 win7: Cannot import QXF/OFX file if path or filename contains non-ascii chars
* bugfix: #942346 internal transactions mixup
* bugfix: #1024907 2 qif export problems that must be fixed
* bugfix: #1074133 Problems with dates: from date to date - does'nt cout the last day of the months
* (bugfix: #1047103 win: Importing QFX causes HomeBank to freeze)
2012-11-17 Maxime Doyen
......
......@@ -8,6 +8,7 @@ hb-categories-it.csv \
hb-categories-pt.csv \
hb-categories-ro.csv \
hb-categories-ru.csv \
hb-categories-sk.csv \
example.xhb
EXTRA_DIST = $(datas_DATA)
......@@ -140,9 +140,9 @@
<ope date="731599" amount="-3" account="0" dst_account="0" paymode="3" flags="1" payee="16" category="49" wording="Cash" info=""/>
<ope date="731602" amount="-48" account="0" dst_account="0" paymode="2" flags="1" payee="12" category="0" wording="PEAVEY Envoy 110" info="8760944"/>
<ope date="731609" amount="-8" account="0" dst_account="0" paymode="1" flags="1" payee="10" category="5" wording="Black shoes" info="26.01"/>
<ope date="731610" amount="-121" account="0" dst_account="0" paymode="5" flags="1" payee="0" category="0" wording="Savings" info=""/>
<ope date="731610" amount="-121.95999999999999" account="0" dst_account="1" paymode="5" flags="1" payee="0" category="0" wording="Savings" info=""/>
<ope date="731610" amount="-2" account="0" dst_account="0" paymode="1" flags="1" payee="7" category="1" wording="Refuel (d=92597 v=15.41)" info="30.01"/>
<ope date="731610" amount="121.95999999999999" account="1" dst_account="0" paymode="5" flags="3" payee="0" category="5" wording="Savings" info=""/>
<ope date="731610" amount="121.95999999999999" account="1" dst_account="0" paymode="5" flags="3" payee="0" category="0" wording="Savings" info=""/>
<ope date="731610" amount="1371" account="0" dst_account="0" paymode="4" flags="3" payee="2" category="57" wording="Amiga Technologies" info=""/>
<ope date="731614" amount="-46" account="0" dst_account="0" paymode="2" flags="1" payee="20" category="6" wording="Harddisk 420Mb" info="8760945"/>
<ope date="731614" amount="-30" account="0" dst_account="0" paymode="1" flags="1" payee="8" category="34" wording="Internet DSL" info=""/>
......@@ -150,8 +150,8 @@
<ope date="731625" amount="-5" account="0" dst_account="0" paymode="1" flags="1" payee="7" category="1" wording="Refuel (d=92788 v=40)" info="14.02"/>
<ope date="731626" amount="-66" account="0" dst_account="0" paymode="4" flags="1" payee="6" category="33" wording="Home sweet home" info=""/>
<ope date="731636" amount="-3" account="0" dst_account="0" paymode="3" flags="1" payee="16" category="49" wording="Cash" info=""/>
<ope date="731638" amount="-121" account="0" dst_account="0" paymode="5" flags="1" payee="0" category="0" wording="Savings" info=""/>
<ope date="731638" amount="121.95999999999999" account="1" dst_account="0" paymode="5" flags="3" payee="0" category="5" wording="Savings" info=""/>
<ope date="731638" amount="-121.95999999999999" account="0" dst_account="1" paymode="5" flags="1" payee="0" category="0" wording="Savings" info=""/>
<ope date="731638" amount="121.95999999999999" account="1" dst_account="0" paymode="5" flags="3" payee="0" category="0" wording="Savings" info=""/>
<ope date="731638" amount="1371" account="0" dst_account="0" paymode="4" flags="3" payee="2" category="57" wording="Amiga Technologies" info=""/>
<ope date="731641" amount="-11" account="0" dst_account="0" paymode="1" flags="1" payee="0" category="5" wording="Levis 501" info="01.03"/>
<ope date="731643" amount="-30" account="0" dst_account="0" paymode="1" flags="1" payee="8" category="34" wording="Internet DSL" info=""/>
......@@ -161,8 +161,8 @@
<ope date="731655" amount="-66" account="0" dst_account="0" paymode="4" flags="1" payee="6" category="33" wording="Home sweet home" info=""/>
<ope date="731667" amount="1371" account="0" dst_account="0" paymode="4" flags="3" payee="2" category="57" wording="Amiga Technologies" info=""/>
<ope date="731668" amount="18" account="0" dst_account="0" paymode="2" flags="3" payee="0" category="0" wording="BOSS BE-5 Sold" info=""/>
<ope date="731670" amount="-121" account="0" dst_account="0" paymode="5" flags="1" payee="0" category="0" wording="Savings" info=""/>
<ope date="731670" amount="121.95999999999999" account="1" dst_account="0" paymode="5" flags="3" payee="0" category="5" wording="Savings" info=""/>
<ope date="731670" amount="-121.95999999999999" account="0" dst_account="1" paymode="5" flags="1" payee="0" category="0" wording="Savings" info=""/>
<ope date="731670" amount="121.95999999999999" account="1" dst_account="0" paymode="5" flags="3" payee="0" category="0" wording="Savings" info=""/>
<ope date="731674" amount="-30" account="0" dst_account="0" paymode="1" flags="0" payee="8" category="34" wording="Internet DSL" info=""/>
<ope date="731675" amount="-31" account="0" dst_account="0" paymode="2" flags="0" payee="0" category="6" wording="Blizzard 1230-IV-50Mhz-8Mb" info="8760949"/>
<ope date="731676" amount="-65" account="0" dst_account="0" paymode="2" flags="0" payee="21" category="1" wording="Car repair" info="8760950"/>
......
1;-;Alimenty
1;-;Automobil
2;-;Náklady na auto
2;-;Benzín
2;-;Údržba
1;-;Bankové poplatky
2;-;Splátky úroku
2;-;Poplatky za služby
1;-;Účty
2;-;Káblová/satelitná televízia
2;-;Mobil
2;-;Elektrina
2;-;Odpad & recyklácia
2;-;Klub zdravia
2;-;Poplatky majiteľovi domu
2;-;Členské poplatky
2;-;Splátka hypotéky
2;-;Olej/benzín natural
2;-;Noviny
2;-;Internet
2;-;Splátka inej pôžičky
2;-;Nájomné
2;-;Splátka študentskej pôžičky
2;-;Telefón
2;-;Vodné a stočné
1;-;Výber hotovosti
1;-;Príspevok na charitu
1;-;Starostlivosť o dieťa
1;-;Deti/hračky
2;-;Vreckové pre deti
2;-;Detské jasle
1;-;Oblečenie
1;-;Platby kreditnou kartou/Transfery
1;-;Reštaurácia/bar
1;-;Vzdelanie
2;-;Knihy
2;-;Poplatky
2;-;Školné
1;-;Zábava
1;-;Poplatky
1;-;Jedlo
1;-;Dary
1;-;Potraviny
1;-;Starostlivosť o zdravie
2;-;Zubár
2;-;Očný lekár
2;-;Nemocnica
2;-;Lekár
2;-;Lieky na predpis
1;-;Hobby/voľný čas
2;-;Knihy a časopisy
2;-;Kultúrne podujatia
2;-;Zabávanie
2;-;Požičovňa videí
2;-;Športové podujaria
2;-;Športové potreby
2;-;Pásky & disky CD
2;-;Hračky & hry
1;-;Domáci majster
1;-;Domácnosť
2;-;Nábytok
2;-;Čistiace prostriedky
2;-;Starostlivosť o záhradu/predzáhradku
1;-;Poistenie
2;-;Automobil
2;-;Životné
2;-;Nehnuteľnosti
2;-;Úrazové
1;-;Pracovné náklady
2;-;Bez refundácie
2;-;S refundáciou
1;-;Pôžička
2;-;Úrok pôžičky
2;-;Úrok hypotéky
2;-;Úrok študentskej pôžičky
1;-;Rozličné
1;-;Hypotéka/nájomné
1;-;Osobná hygiena
1;-;Starostlivosť o zviera
2;-;Jedlo
2;-;Hračky
2;-;Veterinár
1;-;Telefón/Bezdrátový
1;-;Služby/členské
1;-;Dane
2;-;Daň z príjmu
2;-;Daň z príjmu - predchádzajúci rok
2;-;Iné dane
2;-;Daň z nehnuteľnosti
2;-;Miestna daň
1;-;Cestovanie/dovolenka
2;-;Ubytovanie
2;-;Cestovanie
1;-;Pomôcky
1;+;Príjem/Úrok
1;+;Príjem z investície
2;+;Zisky z kapitálu
2;+;Dividendy
2;+;Úrok
2;+;Úrok nepodliehajúci zdaneniu
1;+;Nie výdavok
1;+;Iný príjem
2;+;Prijatá podpora na dieťa
2;+;Zamestnanecká akciová opcia
2;+;Prijaté dary
2;+;Prijatá istina
2;+;Lotéria
2;+;Vrátanie dane
2;+;Podpora v nezamestnanosti
1;+;Prijatý dôchodok
2;+;Mimoriadna odmena za služby
1;+;Plat & mzda
2;+;Bonus
2;+;Provízia
2;+;Hrubá mzda
2;+;Čistý príjem
2;+;Nadčas
2;+;Odstupné
/* HomeBank -- Free, easy, personal accounting for everyone.
* Copyright (C) 1995-2012 Maxime DOYEN
* Copyright (C) 1995-2013 Maxime DOYEN
*
* This file is part of HomeBank.
*
......
/* HomeBank -- Free, easy, personal accounting for everyone.
* Copyright (C) 1995-2012 Maxime DOYEN
* Copyright (C) 1995-2013 Maxime DOYEN
*
* This file is part of HomeBank.
*
......
/* HomeBank -- Free, easy, personal accounting for everyone.
* Copyright (C) 1995-2012 Maxime DOYEN
* Copyright (C) 1995-2013 Maxime DOYEN
*
* This file is part of HomeBank.
*
......@@ -423,7 +423,7 @@ GdkPixbuf *pixbuf;
"Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, "
"MA 02110-1301, USA.";
static const gchar *copyright = "Copyright \xc2\xa9 1995-2012 - Maxime DOYEN";
static const gchar *copyright = "Copyright \xc2\xa9 1995-2013 - Maxime DOYEN";
pathfilename = g_build_filename(homebank_app_get_images_dir(), "splash.png", NULL);
......
/* HomeBank -- Free, easy, personal accounting for everyone.
* Copyright (C) 1995-2012 Maxime DOYEN
* Copyright (C) 1995-2013 Maxime DOYEN
*
* This file is part of HomeBank.
*
......
/* HomeBank -- Free, easy, personal accounting for everyone.
* Copyright (C) 1995-2012 Maxime DOYEN
* Copyright (C) 1995-2013 Maxime DOYEN
*
* This file is part of HomeBank.
*
......
/* HomeBank -- Free, easy, personal accounting for everyone.
* Copyright (C) 1995-2012 Maxime DOYEN
* Copyright (C) 1995-2013 Maxime DOYEN
*
* This file is part of HomeBank.
*
......@@ -115,6 +115,7 @@ struct mycolors
guint8 r, g, b;
};
struct mycolors money_colors[] =
{
{ 255, 193, 96 },
......@@ -145,6 +146,7 @@ struct mycolors money_colors[] =
{ 165, 181, 156 },
};
struct mycolors quicken_colors[] =
{
{ 226, 73, 13 },
......@@ -160,6 +162,7 @@ struct mycolors quicken_colors[] =
{ 113, 113, 113 },
};
struct mycolors analytics_colors[] =
{
{ 5, 141, 199 },
......@@ -176,10 +179,7 @@ struct mycolors analytics_colors[] =
};
struct mycolors excel2010_colors[] =
struct mycolors office2010_colors[] =
{
{ 60, 100, 149 },
{ 150, 60, 59 },
......@@ -467,9 +467,9 @@ void gtk_chart_set_color_scheme(GtkChart * chart, gint colorscheme)
colors = analytics_colors;
nb_colors = G_N_ELEMENTS(analytics_colors);
break;
case CHART_COLMAP_EXCEL2010:
colors = excel2010_colors;
nb_colors = G_N_ELEMENTS(excel2010_colors);
case CHART_COLMAP_OFFICE2010:
colors = office2010_colors;
nb_colors = G_N_ELEMENTS(office2010_colors);
break;
}
}
......@@ -995,6 +995,7 @@ gint blkw;
cr = cairo_create (s);
cairo_text_extents(cr, "ajpq12", &extents);
cairo_destroy(cr);
cairo_surface_destroy(s);
......@@ -1181,7 +1182,7 @@ cairo_text_extents_t extents;
}
}
/* draw x-legend */
/* draw x-legend (amount) */
curxval = chart->max;
for(i=0;i<=chart->div;i++)
......@@ -1198,11 +1199,23 @@ cairo_text_extents_t extents;
//DB( g_print("'%s', %f %f %f %f %f %f\n", valstr, extents.x_bearing, extents.y_bearing, extents.width, extents.height, extents.x_advance, extents.y_advance) );
cairo_set_source_rgb(cr, COLTOCAIRO(102), COLTOCAIRO(102), COLTOCAIRO(102));
// draw white background
cairo_set_line_width (cr, 2);
cairo_set_source_rgba(cr, COLTOCAIRO(255), COLTOCAIRO(255), COLTOCAIRO(255), 0.66);
cairo_move_to(cr, chart->l, y + 2 + extents.height + 0.5);
cairo_text_path (cr, valstr);
cairo_stroke (cr);
cairo_move_to(cr, chart->r - extents.width, y + 2 + extents.height + 0.5);
cairo_text_path (cr, valstr);
cairo_stroke (cr);
// draw texts
cairo_move_to(cr, chart->l, y + 2 + extents.height);
cairo_set_source_rgb(cr, COLTOCAIRO(102), COLTOCAIRO(102), COLTOCAIRO(102));
cairo_show_text(cr, valstr);
cairo_move_to(cr, chart->r - extents.x_advance, y + 2 + extents.height);
cairo_move_to(cr, chart->r - extents.width, y + 2 + extents.height);
cairo_show_text(cr, valstr);
}
......@@ -1302,7 +1315,8 @@ gint i;
}
cairo_destroy(cr);
}
/*
......@@ -1632,6 +1646,7 @@ cairo_t *cr;
cairo_arc(cr, dx, dy, radius, a1, a2);
#if PIE_LINE_SLICE == 1
cairo_set_line_width(cr, 1.0);
cairo_set_source_rgb(cr, 1.0, 1.0, 1.0);
cairo_line_to(cr, cx, cy);
cairo_stroke_preserve(cr);
......
/* HomeBank -- Free, easy, personal accounting for everyone.
* Copyright (C) 1995-2012 Maxime DOYEN
* Copyright (C) 1995-2013 Maxime DOYEN
*
* This file is part of HomeBank.
*
......@@ -50,7 +50,11 @@ enum
CHART_TYPE_MAX
};
/* default zoomx for charts */
#define GTK_CHART_MINBARW 8
#define GTK_CHART_BARW 24
#define GTK_CHART_MAXBARW 64
#define CHART_BUFFER_LENGTH 128
#define NUM_COLORMAP_MAX 24
......@@ -69,7 +73,7 @@ enum
CHART_COLMAP_MSMONEY,
CHART_COLMAP_QUICKEN,
CHART_COLMAP_ANALYTICS,
CHART_COLMAP_EXCEL2010
CHART_COLMAP_OFFICE2010
};
......
/* HomeBank -- Free, easy, personal accounting for everyone.
* Copyright (C) 1995-2012 Maxime DOYEN
* Copyright (C) 1995-2013 Maxime DOYEN
*
* This file is part of HomeBank.
*
......@@ -109,7 +109,7 @@ g_date_fill_parse_tokens (const gchar *str, GDateParseTokens *pt)
gint i;
const guchar *s;
DB( g_print(" (dateentry) fill parse token\n") );
DB( g_print("\n[dateentry] fill parse token\n") );
/* We count 4, but store 3; so we can give an error
* if there are 4.
......@@ -153,7 +153,7 @@ gchar buf[128];
GDateParseTokens testpt;
gint i;
DB( g_print(" (dateentry) determine dmy\n") );
DB( g_print("\n[dateentry] determine dmy\n") );
g_date_clear (&d, 1); /* clear for scratch use */
......@@ -200,7 +200,7 @@ gtk_dateentry_get_type ()
{
static GType dateentry_type = 0;
//DB( g_print(" (dateentry) get_type\n") );
//DB( g_print("\n[dateentry] get_type\n") );
if (!dateentry_type)
{
......@@ -240,7 +240,7 @@ gtk_dateentry_class_init (GtkDateEntryClass * klass)
parent_class = g_type_class_peek_parent (klass);
DB( g_print(" (dateentry) class_init\n") );
DB( g_print("\n[dateentry] class_init\n") );
object_class->destroy = gtk_dateentry_destroy;
......@@ -279,7 +279,7 @@ static gboolean gtk_dateentry_focus(GtkWidget *widget,
{
GtkDateEntry *dateentry = user_data;
DB( g_print(" (dateentry) focus-out-event %d\n", gtk_widget_is_focus(GTK_WIDGET(dateentry))) );
DB( g_print("\n[dateentry] focus-out-event %d\n", gtk_widget_is_focus(GTK_WIDGET(dateentry))) );
gtk_dateentry_entry_new(GTK_WIDGET(dateentry), dateentry);
......@@ -292,7 +292,7 @@ gtk_dateentry_init (GtkDateEntry *dateentry)
GtkWidget *widget;
GtkWidget *arrow;
DB( g_print(" (dateentry) init\n") );
DB( g_print("\n[dateentry] init\n") );
/* initialize datas */
dateentry->date = g_date_new();
......@@ -358,39 +358,34 @@ GtkWidget *arrow;
G_CALLBACK (gtk_dateentry_calendar_year), dateentry);
g_signal_connect (GTK_OBJECT (dateentry->calendar), "day-selected",
G_CALLBACK (gtk_dateentry_calendar_getfrom), dateentry);
g_signal_connect (GTK_OBJECT (dateentry->calendar), "day-selected-double-click",
G_CALLBACK (gtk_dateentry_calendar_select), dateentry);
/*g_signal_connect (GTK_OBJECT (dateentry->calendar), "month-changed",
G_CALLBACK (gtk_dateentry_calendar_select), dateentry);*/
gtk_dateentry_calendar_getfrom(NULL, dateentry);
}
// the rest
GtkWidget *
gtk_dateentry_new ()
GtkWidget *gtk_dateentry_new ()
{
GtkDateEntry *dateentry;
DB( g_print(" (dateentry) new\n") );
DB( g_print("\n[dateentry] new\n") );
dateentry = g_object_new (GTK_TYPE_DATE_ENTRY, NULL);
return GTK_WIDGET(dateentry);
}
static void
gtk_dateentry_destroy (GtkObject * object)
static void gtk_dateentry_destroy (GtkObject * object)
{
GtkDateEntry *dateentry;
DB( g_print(" \n(dateentry) destroy\n") );
DB( g_print(" \n[dateentry] destroy\n") );
g_return_if_fail (GTK_IS_DATE_ENTRY (object));
g_return_if_fail (GTK_IS_DATE_ENTRY (object));
dateentry = GTK_DATE_ENTRY (object);
......@@ -416,6 +411,8 @@ GtkDateEntry *dateentry;
*/
void gtk_dateentry_set_date(GtkDateEntry *dateentry, guint32 julian_days)
{
DB( g_print(" \n[dateentry] set date\n") );
g_return_if_fail (GTK_IS_DATE_ENTRY (dateentry));
if(g_date_valid_julian(julian_days))
......@@ -434,6 +431,8 @@ void gtk_dateentry_set_date(GtkDateEntry *dateentry, guint32 julian_days)
*/
guint32 gtk_dateentry_get_date(GtkDateEntry * dateentry)
{
DB( g_print(" \n[dateentry] get date\n") );
g_return_val_if_fail (GTK_IS_DATE_ENTRY (dateentry), 0);
return(g_date_get_julian(dateentry->date));
......@@ -449,7 +448,7 @@ gtk_dateentry_set_property (GObject *object,
{
GtkDateEntry *dateentry = GTK_DATE_ENTRY (object);
DB( g_print(" (dateentry) set %d\n", prop_id) );
DB( g_print("\n[dateentry] set %d\n", prop_id) );
switch (prop_id)
......@@ -478,7 +477,7 @@ gtk_dateentry_get_property (GObject *object,
{
GtkDateEntry *dateentry = GTK_DATE_ENTRY (object);
DB( g_print(" (dateentry) get\n") );
DB( g_print("\n[dateentry] get\n") );
switch (prop_id)
{
......@@ -501,7 +500,7 @@ static void gtk_dateentry_datetoentry(GtkDateEntry * dateentry)
{
gchar buffer[256];
DB( g_print(" (dateentry) date2entry\n") );
DB( g_print("\n[dateentry] date2entry\n") );
g_date_clamp(dateentry->date, &dateentry->mindate, &dateentry->maxdate);
......@@ -520,7 +519,7 @@ gchar buffer[256];
/* emit the signal */
if(dateentry->lastdate != g_date_get_julian(dateentry->date))
{
DB( g_print(" **emit 'chnaged' signal**\n") );
DB( g_print(" **emit 'changed' signal**\n") );
g_signal_emit_by_name (dateentry, "changed", NULL, NULL);
}
......@@ -589,7 +588,7 @@ static void gtk_dateentry_entry_new(GtkWidget *gtkentry, gpointer user_data)
GtkDateEntry *dateentry = user_data;
const gchar *str;
DB( g_print(" (dateentry) entry validation\n") );
DB( g_print("\n[dateentry] entry_new\n") );
str = gtk_entry_get_text (GTK_ENTRY (dateentry->entry));
......@@ -617,7 +616,7 @@ static void gtk_dateentry_calendar_year(GtkWidget *calendar, GtkDateEntry *datee
{
guint year, month, day;
DB( g_print(" (dateentry) year changed\n") );
DB( g_print("\n[dateentry] calendar_year\n") );
gtk_calendar_get_date (GTK_CALENDAR (dateentry->calendar), &year, &month, &day);
if( year < 1900)
......@@ -635,10 +634,16 @@ static void gtk_dateentry_calendar_getfrom(GtkWidget * calendar, GtkDateEntry *
{
guint year, month, day;
DB( g_print(" (dateentry) get from calendar\n") );
DB( g_print("\n[dateentry] calendar_getfrom\n") );
gtk_calendar_get_date (GTK_CALENDAR (dateentry->calendar), &year, &month, &day);
if(g_date_get_day (dateentry->date) != day)
{
gtk_dateentry_hide_popdown_window(dateentry);
}
g_date_set_dmy (dateentry->date, day, month + 1, year);
gtk_dateentry_datetoentry(dateentry);
}
......@@ -647,10 +652,10 @@ static void gtk_dateentry_calendar_select(GtkWidget * calendar, gpointer user_da
{
GtkDateEntry *dateentry = user_data;
DB( g_print(" (dateentry) calendar_select\n") );
DB( g_print("\n[dateentry] calendar_day_select\n") );
gtk_dateentry_hide_popdown_window(dateentry);
gtk_dateentry_calendar_getfrom(NULL, dateentry);
//gtk_dateentry_hide_popdown_window(dateentry);
}
......@@ -659,7 +664,7 @@ gtk_dateentry_entry_key (GtkWidget *widget, GdkEventKey *event, gpointer user_da
{
GtkDateEntry *dateentry = user_data;
DB( g_print(" (dateentry) entry key pressed: state=%04x, keyval=%04x\n", event->state, event->keyval) );
DB( g_print("\n[dateentry] entry key pressed: state=%04x, keyval=%04x\n", event->state, event->keyval) );
if( event->keyval == GDK_Up )
{
......@@ -716,7 +721,7 @@ position_popup (GtkDateEntry * dateentry)
gint bwidth, bheight;
GtkRequisition req;
DB( g_print(" (dateentry) position popup\n") );
DB( g_print("\n[dateentry] position popup\n") );
gtk_widget_size_request (dateentry->popwin, &req);
......@@ -750,7 +755,7 @@ int month;
//gint height, width, x, y;
//gint old_width, old_height;
DB( g_print(" (dateentry) popup_display\n****\n\n") );
DB( g_print("\n[dateentry] popup_display\n****\n\n") );
//old_width = dateentry->popwin->allocation.width;
//old_height = dateentry->popwin->allocation.height;
......@@ -790,7 +795,7 @@ int month;
static void
gtk_dateentry_hide_popdown_window(GtkDateEntry *dateentry)
{
DB( g_print(" (dateentry) hide_popdown_window\n") );
DB( g_print("\n[dateentry] hide_popdown_window\n") );
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dateentry->arrow), FALSE);
......@@ -804,7 +809,7 @@ gtk_dateentry_arrow_press (GtkWidget * widget, GtkDateEntry * dateentry)
{
GtkToggleButton *button;
DB( g_print(" (dateentry) arrow_press\n") );
DB( g_print("\n[dateentry] arrow_press\n") );
button = GTK_TOGGLE_BUTTON(widget);
......@@ -827,7 +832,7 @@ key_press_popup (GtkWidget *widget, GdkEventKey *event, gpointer user_data)
GtkDateEntry *dateentry = user_data;
DB( g_print(" (dateentry) key pressed%d\n", event->keyval) );
DB( g_print("\n[dateentry] key pressed%d\n", event->keyval) );
if (event->keyval != GDK_Escape)
return FALSE;
......@@ -850,7 +855,7 @@ gtk_dateentry_button_press (GtkWidget * widget, GdkEvent * event, gpointer data)
{
GtkWidget *child;
DB( g_print(" (dateentry) button_press\n") );
DB( g_print("\n[dateentry] button_press\n") );
child = gtk_get_event_widget (event);
......
/* HomeBank -- Free, easy, personal accounting for everyone.
* Copyright (C) 1995-2012 Maxime DOYEN
* Copyright (C) 1995-2013 Maxime DOYEN
*
* This file is part of HomeBank.
*
......
/* HomeBank -- Free, easy, personal accounting for everyone.
* Copyright (C) 1995-2012 Maxime DOYEN
* Copyright (C) 1995-2013 Maxime DOYEN
*
* This file is part of HomeBank.
*
......@@ -190,7 +190,7 @@ guint32 *new_key;
DB( g_print("da_acc_append\n") );
/* ensure no duplicate */
//g_strstrip(item->name);
g_strstrip(item->name);
if(item->name != NULL)
{
existitem = da_acc_get_by_name( item->name );
......@@ -275,7 +275,10 @@ da_acc_get(guint32 key)
}
void da_acc_consistency(Account *item)
{
g_strstrip(item->name);
}
/* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = */
......@@ -306,6 +309,42 @@ da_acc_debug_list(void)
#endif
static gint
account_glist_name_compare_func(Account *a, Account *b)
{
gint retval = 0;
if (a->name == NULL || b->name == NULL)
{
retval = (a->name == NULL) ? -1 : 1;
}
else
{
retval = g_utf8_collate(a->name, b->name);
}
return retval;
}
static gint
account_glist_key_compare_func(Account *a, Account *b)
{
return a->key - b->key;
}
GList *account_glist_sorted(gint column)
{
GList *list = g_hash_table_get_values(GLOBALS->h_acc);
if(column == 0)
return g_list_sort(list, (GCompareFunc)account_glist_key_compare_func);
else
return g_list_sort(list, (GCompareFunc)account_glist_name_compare_func);
}