X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;ds=sidebyside;f=src%2Fhb-preferences.c;h=8a9fb60e810199ca61f6430609098f44b76295bb;hb=35b9973e4de7d69ad8841ead996a2e6cf1d85f08;hp=d257ca7c3dcc7035f0713b8d0ed155ad90c9f552;hpb=e62ea69f02705c3b332a6a14f0cbf0a8c0c93d8b;p=chaz%2Fhomebank diff --git a/src/hb-preferences.c b/src/hb-preferences.c index d257ca7..8a9fb60 100644 --- a/src/hb-preferences.c +++ b/src/hb-preferences.c @@ -1,5 +1,5 @@ /* HomeBank -- Free, easy, personal accounting for everyone. - * Copyright (C) 1995-2016 Maxime DOYEN + * Copyright (C) 1995-2018 Maxime DOYEN * * This file is part of HomeBank. * @@ -357,6 +357,10 @@ gint i; PREFS->wal_vpaned = 600/2; PREFS->wal_hpaned = 1024/2; + PREFS->pnl_acc_col_acc_width = -1; + PREFS->pnl_acc_show_by = 0; + PREFS->pnl_upc_col_pay_width = -1; + PREFS->pnl_upc_col_mem_width = -1; i = 0; @@ -365,7 +369,7 @@ gint i; PREFS->lst_ope_columns[i++] = LST_DSPOPE_DATE; PREFS->lst_ope_columns[i++] = LST_DSPOPE_INFO; PREFS->lst_ope_columns[i++] = LST_DSPOPE_PAYEE; - PREFS->lst_ope_columns[i++] = LST_DSPOPE_WORDING; + PREFS->lst_ope_columns[i++] = LST_DSPOPE_MEMO; PREFS->lst_ope_columns[i++] = -LST_DSPOPE_AMOUNT; PREFS->lst_ope_columns[i++] = LST_DSPOPE_EXPENSE; PREFS->lst_ope_columns[i++] = LST_DSPOPE_INCOME; @@ -383,7 +387,7 @@ gint i; PREFS->lst_ope_columns[i++] = LST_DSPOPE_EXPENSE; PREFS->lst_ope_columns[i++] = LST_DSPOPE_INCOME; PREFS->lst_ope_columns[i++] = LST_DSPOPE_BALANCE; - PREFS->lst_ope_columns[i++] = LST_DSPOPE_WORDING; + PREFS->lst_ope_columns[i++] = LST_DSPOPE_MEMO; PREFS->lst_ope_sort_id = LST_DSPOPE_DATE; PREFS->lst_ope_sort_order = GTK_SORT_ASCENDING; @@ -430,7 +434,7 @@ gint i; PREFS->vehicle_unit_ismile = FALSE; PREFS->vehicle_unit_isgal = FALSE; - gchar** plugin_path = g_new0(gchar**, 4); + gchar** plugin_path = g_new0(gchar*, 4); i = 0; const gchar* env = g_getenv("HOMEBANK_PLUGINS"); if (env) { @@ -561,7 +565,9 @@ gchar *string; string = g_key_file_get_string(key_file, group_name, key, NULL); if( string != NULL ) { - *storage = g_strdup(string); + //*storage = g_strdup(string); + //leak + *storage = string; //already a new allocated string //DB( g_print(" store '%s' for %s at %x\n", string, key, *storage) ); } @@ -781,6 +787,10 @@ GError *error = NULL; DB( g_print(" - copying column width from pref file\n") ); memcpy(PREFS->lst_ope_col_size, src, length*sizeof(gint)); } + + //leak + g_free(src); + } homebank_pref_get_integer(keyfile, group, "OpeSortId", &PREFS->lst_ope_sort_id); @@ -823,6 +833,17 @@ GError *error = NULL; homebank_pref_get_boolean(keyfile, group, "WalSpending", &PREFS->wal_spending); homebank_pref_get_boolean(keyfile, group, "WalUpcoming", &PREFS->wal_upcoming); + //since 5.1.3 + group = "Panels"; + + DB( g_print(" -> ** Panels\n") ); + + homebank_pref_get_short(keyfile, group, "AccColAccW", &PREFS->pnl_acc_col_acc_width); + homebank_pref_get_short(keyfile, group, "AccShowBy" , &PREFS->pnl_acc_show_by); + + homebank_pref_get_short(keyfile, group, "UpcColPayW", &PREFS->pnl_upc_col_pay_width); + homebank_pref_get_short(keyfile, group, "UpcColMemW", &PREFS->pnl_upc_col_mem_width); + group = "Format"; @@ -934,6 +955,7 @@ GError *error = NULL; DB( g_print(" -> ** Exchange\n") ); //homebank_pref_get_boolean(keyfile, group, "DoIntro", &PREFS->dtex_nointro); + homebank_pref_get_integer(keyfile, group, "DateFmt", &PREFS->dtex_datefmt); homebank_pref_get_integer(keyfile, group, "OfxName", &PREFS->dtex_ofxname); homebank_pref_get_integer(keyfile, group, "OfxMemo", &PREFS->dtex_ofxmemo); @@ -1029,6 +1051,8 @@ gsize length; g_key_file_set_integer (keyfile, group, "BarStyle", PREFS->toolbar_style); //g_key_file_set_integer (keyfile, group, "BarImageSize", PREFS->image_size); + + g_key_file_set_boolean (keyfile, group, "CustomColors", PREFS->custom_colors); g_key_file_set_string (keyfile, group, "ColorExp" , PREFS->color_exp); g_key_file_set_string (keyfile, group, "ColorInc" , PREFS->color_inc); @@ -1041,6 +1065,9 @@ gsize length; homebank_pref_set_string (keyfile, group, "ExportPath" , PREFS->path_export); //g_key_file_set_string (keyfile, group, "NavigatorPath", PREFS->path_navigator); + + + g_key_file_set_boolean (keyfile, group, "ShowSplash", PREFS->showsplash); g_key_file_set_boolean (keyfile, group, "LoadLast", PREFS->loadlast); g_key_file_set_boolean (keyfile, group, "AppendScheduled", PREFS->appendscheduled); @@ -1078,6 +1105,16 @@ gsize length; g_key_file_set_boolean (keyfile, group, "WalSpending", PREFS->wal_spending); g_key_file_set_boolean (keyfile, group, "WalUpcoming", PREFS->wal_upcoming); + //since 5.1.3 + DB( g_print(" -> ** Panels\n") ); + + group = "Panels"; + g_key_file_set_integer(keyfile, group, "AccColAccW", PREFS->pnl_acc_col_acc_width); + g_key_file_set_integer(keyfile, group, "AccShowBy" , PREFS->pnl_acc_show_by); + + g_key_file_set_integer(keyfile, group, "UpcColPayW", PREFS->pnl_upc_col_pay_width); + g_key_file_set_integer(keyfile, group, "UpcColMemW", PREFS->pnl_upc_col_mem_width); + DB( g_print(" -> ** format\n") ); @@ -1094,7 +1131,7 @@ gsize length; group = "Filter"; g_key_file_set_integer (keyfile, group, "DateRangeWal", PREFS->date_range_wal); g_key_file_set_integer (keyfile, group, "DateRangeTxn", PREFS->date_range_txn); - g_key_file_set_integer (keyfile, group, "DateFutureNbdays", PREFS->date_future_nbdays); + g_key_file_set_integer (keyfile, group, "DateFutureNbDays", PREFS->date_future_nbdays); g_key_file_set_integer (keyfile, group, "DateRangeRep", PREFS->date_range_rep); DB( g_print(" -> ** euro\n") ); @@ -1131,6 +1168,7 @@ gsize length; group = "Exchange"; //g_key_file_set_boolean (keyfile, group, "DoIntro", PREFS->dtex_nointro); + g_key_file_set_integer (keyfile, group, "DateFmt", PREFS->dtex_datefmt); g_key_file_set_integer (keyfile, group, "OfxName", PREFS->dtex_ofxname); g_key_file_set_integer (keyfile, group, "OfxMemo", PREFS->dtex_ofxmemo);