From: Charles McGarvey Date: Sun, 26 May 2019 21:12:22 +0000 (-0600) Subject: revert whitespace fixes X-Git-Url: https://git.brokenzipper.com/gitweb?a=commitdiff_plain;h=bdebe90556646c9672ca2e4f84c0cc654cbccc8f;p=chaz%2Fhomebank revert whitespace fixes --- diff --git a/.editorconfig b/.editorconfig index d9a081e..4756e24 100644 --- a/.editorconfig +++ b/.editorconfig @@ -17,3 +17,10 @@ indent_style = space insert_final_newline = false trim_trailing_whitespace = false +[*.{pl,pm}] +charset = utf8 +indent_size = 4 +indent_style = space +insert_final_newline = true +trim_trailing_whitespace = true + diff --git a/Makefile.am b/Makefile.am index 45d1f49..6d3f36a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,6 +1,6 @@ # HomeBank Makefile.am -ACLOCAL_AMFLAGS = -I m4 +ACLOCAL_AMFLAGS = -I m4 #SUBDIRS = src SUBDIRS = src data images mime pixmaps themes po doc plugins @@ -28,6 +28,7 @@ DISTCLEANFILES = ... intltool-extract \ intltool-update \ po/.intltool-merge-cache + # we clean every folder under /usr/share/homebank as well on uninstall uninstall-hook: -rm -rf $(datadir)/homebank/datas diff --git a/configure.ac b/configure.ac index baf00bf..eece8dc 100644 --- a/configure.ac +++ b/configure.ac @@ -83,33 +83,33 @@ fi AM_CONDITIONAL(NOOFX, test x$noofx = xtrue) AC_ARG_WITH(perl, - [ --with-perl build with perl plug-in support [default=without]], - [build_perl=$withval], - [build_perl=no] + [ --with-perl build with perl plug-in support [default=without]], + [build_perl=$withval], + [build_perl=no] ) if test x$build_perl != xno then - test x$build_perl != xyes -a -x "$build_perl" && PERL=$build_perl - AC_PATH_PROG(PERL, perl, perl) - AC_MSG_CHECKING(if perl can be embedded) - if $PERL -MExtUtils::Embed -e "use v5.8" >/dev/null 2>&1 - then - AC_MSG_RESULT(yes) - CPPFLAGS="${CPPFLAGS} -DPERL_ENABLE" - PERL_CPPFLAGS="`$PERL -MExtUtils::Embed -e ccopts`" - PERL_OBJS="ext-perl.o perlxsi.o" - PERL_PRIVLIBEXP="`$PERL -MConfig -e 'print $Config{privlibexp}'`" - PERL_SITELIBEXP="`$PERL -MConfig -e 'print $Config{sitelibexp}'`" - DEPS_LIBS="`$PERL -MExtUtils::Embed -e ldopts` ${DEPS_LIBS}" - if test -e "$PERL_SITELIBEXP/ExtUtils/xsubpp" - then - XSUBPP="$PERL $PERL_SITELIBEXP/ExtUtils/xsubpp" - else - XSUBPP="$PERL $PERL_PRIVLIBEXP/ExtUtils/xsubpp" - fi - else - AC_MSG_ERROR([no working perl found, or perl not version >= 5.8]) - fi + test x$build_perl != xyes -a -x "$build_perl" && PERL=$build_perl + AC_PATH_PROG(PERL, perl, perl) + AC_MSG_CHECKING(if perl can be embedded) + if $PERL -MExtUtils::Embed -e "use v5.8" >/dev/null 2>&1 + then + AC_MSG_RESULT(yes) + CPPFLAGS="${CPPFLAGS} -DPERL_ENABLE" + PERL_CPPFLAGS="`$PERL -MExtUtils::Embed -e ccopts`" + PERL_OBJS="ext-perl.o perlxsi.o" + PERL_PRIVLIBEXP="`$PERL -MConfig -e 'print $Config{privlibexp}'`" + PERL_SITELIBEXP="`$PERL -MConfig -e 'print $Config{sitelibexp}'`" + DEPS_LIBS="`$PERL -MExtUtils::Embed -e ldopts` ${DEPS_LIBS}" + if test -e "$PERL_SITELIBEXP/ExtUtils/xsubpp" + then + XSUBPP="$PERL $PERL_SITELIBEXP/ExtUtils/xsubpp" + else + XSUBPP="$PERL $PERL_PRIVLIBEXP/ExtUtils/xsubpp" + fi + else + AC_MSG_ERROR([no working perl found, or perl not version >= 5.8]) + fi fi AC_SUBST(PERL_CPPFLAGS) AC_SUBST(PERL_OBJS) diff --git a/plugins/Makefile.am b/plugins/Makefile.am index 62a7111..e5762a3 100644 --- a/plugins/Makefile.am +++ b/plugins/Makefile.am @@ -1,12 +1,12 @@ -plugindir = $(pkglibdir)/plugins +plugindir = $(pkglibdir)/plugins -native_la_LDFLAGS = -module -avoid-version -shared -export-dynamic +native_la_LDFLAGS = -module -avoid-version -shared -export-dynamic -native_la_SOURCES = native.c +native_la_SOURCES = native.c -native_la_CPPFLAGS = $(DEPS_CFLAGS) -I$(top_srcdir)/src -native_la_LIBADD = $(DEPS_LIBS) +native_la_CPPFLAGS = $(DEPS_CFLAGS) -I$(top_srcdir)/src +native_la_LIBADD = $(DEPS_LIBS) -plugin_LTLIBRARIES = native.la +plugin_LTLIBRARIES = native.la diff --git a/plugins/hello.pl b/plugins/hello.pl index 25520b5..0b133c5 100644 --- a/plugins/hello.pl +++ b/plugins/hello.pl @@ -33,22 +33,22 @@ sub new { my $self = $class->SUPER::new(@_); $self->on(account_inserted => sub { - my $acc = shift; - print "account inserted: ", Dumper($acc); - print "account name is ", $acc->name, " and balance is ", $acc->bank_balance, "\n"; - #$acc->name("FOOOOBAR!"); - if ($acc->name eq 'Vacation') { - $acc->remove; - $ACC = $acc; - } - print Dumper($acc->is_inserted); - if ($acc->is_inserted) { - print "IT IS INSERTED\n"; - } else { - print "not inserted\n"; - } - print Dumper($acc->transactions); - }); + my $acc = shift; + print "account inserted: ", Dumper($acc); + print "account name is ", $acc->name, " and balance is ", $acc->bank_balance, "\n"; + #$acc->name("FOOOOBAR!"); + if ($acc->name eq 'Vacation') { + $acc->remove; + $ACC = $acc; + } + print Dumper($acc->is_inserted); + if ($acc->is_inserted) { + print "IT IS INSERTED\n"; + } else { + print "not inserted\n"; + } + print Dumper($acc->transactions); + }); #print $self->cool_beans, "\n"; #$self->cool_beans(123); @@ -92,21 +92,20 @@ sub on_test { Dump($button); print Dumper($button); $button->signal_connect(clicked => sub { - print "Hello Gtk3-Perl: $counter (perl plugin: $self)\n"; - $counter++; - #if ($temp->is_inserted) { - #print "$temp is inserted\n"; - #} else { - #print "$temp is NOT inserted\n"; - #} - #if ($counter == 5) { - #$temp = undef; - #} - my $acc = HomeBank::Account->get(rand(10)); - print "Changin account named ", $acc->name, " to ", $acc->name($acc), "\n"; - HomeBank->main_window->queue_draw; - - }); + print "Hello Gtk3-Perl: $counter (perl plugin: $self)\n"; + $counter++; + #if ($temp->is_inserted) { + #print "$temp is inserted\n"; + #} else { + #print "$temp is NOT inserted\n"; + #} + #if ($counter == 5) { + #$temp = undef; + #} + my $acc = HomeBank::Account->get(rand(10)); + print "Changin account named ", $acc->name, " to ", $acc->name($acc), "\n"; + HomeBank->main_window->queue_draw; + }); $window->add($button); $window->show_all; diff --git a/src/dsp-mainwindow.c b/src/dsp-mainwindow.c index 927ebaa..f9dd0ea 100644 --- a/src/dsp-mainwindow.c +++ b/src/dsp-mainwindow.c @@ -194,7 +194,7 @@ static GtkActionEntry entries[] = { //{ "ImportQIF" , ICONNAME_HB_FILE_IMPORT , N_("QIF file...") , NULL, N_("Open the import assistant"), G_CALLBACK (ui_mainwindow_action_import) }, //{ "ImportOFX" , ICONNAME_HB_FILE_IMPORT , N_("OFX/QFX file...") , NULL, N_("Open the import assistant"), G_CALLBACK (ui_mainwindow_action_import) }, //{ "ImportCSV" , ICONNAME_HB_FILE_IMPORT , N_("CSV file...") , NULL, N_("Open the import assistant"), G_CALLBACK (ui_mainwindow_action_import) }, - + { "ExportQIF" , ICONNAME_HB_FILE_EXPORT , N_("Export as QIF...") , NULL, N_("Export all account in a QIF file"), G_CALLBACK (ui_mainwindow_action_export) }, /* EditMenu */ @@ -398,7 +398,7 @@ gint result; title = g_strdup_printf ( _("Revert unsaved changes to file '%s'?"), basename); - secondtext = + secondtext = _("- Changes made to the file will be permanently lost\n" "- File will be reloaded from the last save (.xhb~)"); @@ -415,7 +415,7 @@ gint result; if( result == GTK_RESPONSE_OK ) { DB( g_print(" - should revert\n") ); - + hbfile_change_filepath(hb_filename_new_with_extension(GLOBALS->xhb_filepath, "xhb~")); ui_mainwindow_open_internal(widget, NULL); hbfile_change_filepath(hb_filename_new_with_extension(GLOBALS->xhb_filepath, "xhb")); @@ -430,7 +430,7 @@ activate_url (GtkAboutDialog *about, gpointer data) { DB( g_print("activate url %s\n", link) ); - + homebank_util_url_show (link); } @@ -470,18 +470,18 @@ gchar *version; gtk_get_major_version (), gtk_get_minor_version (), gtk_get_micro_version ()); - + dialog = gtk_about_dialog_new(); gtk_window_set_transient_for (GTK_WINDOW(dialog), GTK_WINDOW(GLOBALS->mainwindow)); gtk_window_set_modal(GTK_WINDOW(dialog), TRUE); - + gtk_about_dialog_set_program_name (GTK_ABOUT_DIALOG(dialog), g_get_application_name ()); gtk_about_dialog_set_version(GTK_ABOUT_DIALOG(dialog), version); gtk_about_dialog_set_copyright(GTK_ABOUT_DIALOG(dialog), copyright); gtk_about_dialog_set_comments(GTK_ABOUT_DIALOG(dialog), _("Free, easy, personal accounting for everyone")); gtk_about_dialog_set_license_type (GTK_ABOUT_DIALOG(dialog), GTK_LICENSE_GPL_2_0); - + //gtk_about_dialog_set_wrap_license(GTK_ABOUT_DIALOG(dialog), ); gtk_about_dialog_set_website(GTK_ABOUT_DIALOG(dialog), "http://homebank.free.fr"); gtk_about_dialog_set_website_label(GTK_ABOUT_DIALOG(dialog), "Visit the HomeBank website"); @@ -497,7 +497,7 @@ gchar *version; gtk_about_dialog_set_logo(GTK_ABOUT_DIALOG(dialog), pixbuf); g_object_unref (pixbuf); } - + gtk_about_dialog_set_authors(GTK_ABOUT_DIALOG(dialog), authors); gtk_about_dialog_set_artists(GTK_ABOUT_DIALOG(dialog), artists); //gtk_about_dialog_set_documenters(GTK_ABOUT_DIALOG(dialog), ); @@ -510,7 +510,7 @@ gchar *version; gtk_widget_destroy (dialog); g_free(version); - + } @@ -606,7 +606,7 @@ gchar *secondtext; title = _("Are you sure you want to anonymize the file?"); - secondtext = + secondtext = _("Proceeding will anonymize any text, \n" "like 'account x', 'payee y', 'memo z', ..."); @@ -619,7 +619,7 @@ gchar *secondtext; //#1707201 //if( result == GTK_RESPONSE_CANCEL ) - // return; + // return; if( result == GTK_RESPONSE_OK ) { hbfile_anonymize(); @@ -770,7 +770,7 @@ struct hbfile_data *data = g_object_get_data(G_OBJECT(GLOBALS->mainwindow), "ins // top spending gtk_chart_show_minor(GTK_CHART(data->RE_pie), GLOBALS->minor); - + ui_hub_spending_update(data->window, data); } @@ -836,7 +836,7 @@ static void ui_mainwindow_action_statistic(void) static void ui_mainwindow_action_trendtime(void) { struct hbfile_data *data = g_object_get_data(G_OBJECT(GLOBALS->mainwindow), "inst_data"); - + ui_reptime_window_new(data->acc != NULL ? data->acc->key : 0); } @@ -964,7 +964,7 @@ GtkWidget *mainvbox, *widget, *label; NULL); content_area = gtk_dialog_get_content_area(GTK_DIALOG (dialog)); - + mainvbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); gtk_box_pack_start (GTK_BOX (content_area), mainvbox, FALSE, FALSE, 0); gtk_container_set_border_width (GTK_CONTAINER(mainvbox), SPACING_MEDIUM); @@ -990,11 +990,11 @@ GtkWidget *mainvbox, *widget, *label; widget = gtk_button_new_with_mnemonic(_("Read HomeBank _Manual")); gtk_box_pack_start (GTK_BOX (mainvbox), widget, FALSE, FALSE, 0); g_signal_connect (widget, "clicked", G_CALLBACK (ui_mainwindow_action_help_welcome1), dialog); - + widget = gtk_button_new_with_mnemonic(_("Configure _preferences")); gtk_box_pack_start (GTK_BOX (mainvbox), widget, FALSE, FALSE, 0); g_signal_connect (widget, "clicked", G_CALLBACK (ui_mainwindow_action_help_welcome2), dialog); - + widget = gtk_button_new_with_mnemonic(_("Create a _new file")); gtk_box_pack_start (GTK_BOX (mainvbox), widget, FALSE, FALSE, 0); g_signal_connect (widget, "clicked", G_CALLBACK (ui_mainwindow_action_help_welcome3), dialog); @@ -1129,10 +1129,10 @@ gboolean file_clear = GPOINTER_TO_INT(user_data); gtk_tree_store_clear(GTK_TREE_STORE(gtk_tree_view_get_model(GTK_TREE_VIEW(data->LV_acc)))); gtk_list_store_clear(GTK_LIST_STORE(gtk_tree_view_get_model(GTK_TREE_VIEW(data->LV_upc)))); gtk_list_store_clear(GTK_LIST_STORE(gtk_tree_view_get_model(GTK_TREE_VIEW(data->LV_top)))); - + data->showall = FALSE; ui_hub_account_setup(data); - + hbfile_cleanup(file_clear); hbfile_setup(file_clear); @@ -1177,7 +1177,7 @@ gint account, count; if( PREFS->heritdate == FALSE ) //fix: 318733 ope->date = GLOBALS->today; - + da_transaction_set_default_template(ope); } @@ -1197,7 +1197,7 @@ gint account, count; DB( g_print(" - added 1 transaction to %d\n", ope->kacc) ); ui_hub_account_populate(GLOBALS->mainwindow, NULL); - + count++; //todo: still usefull ? store last date date = ope->date; @@ -1232,21 +1232,21 @@ gboolean result; basename = g_path_get_basename(filepath); secondtext = g_strdup_printf ( - _("Your are about to open the backup file '%s'.\n\nAre you sure you want to do this ?"), basename); + _("Your are about to open the backup file '%s'.\n\nAre you sure you want to do this ?"), basename); result = ui_dialog_msg_confirm_alert( GTK_WINDOW(GLOBALS->mainwindow), _("Open the backup file ?"), secondtext, _("_Open backup") - ); + ); g_free(secondtext); g_free(basename); if( result == GTK_RESPONSE_OK ) retval = TRUE; - + return retval; } @@ -1285,7 +1285,7 @@ gchar *filename = NULL; g_free(filename); return; } - } + } hbfile_change_filepath(filename); ui_mainwindow_open_internal(widget, NULL); @@ -1320,7 +1320,7 @@ gint r; GLOBALS->xhb_timemodified = hbfile_file_get_time_modified(GLOBALS->xhb_filepath); hbfile_file_hasrevert(GLOBALS->xhb_filepath); - + if(PREFS->appendscheduled) scheduled_post_all_pending(); @@ -1365,7 +1365,7 @@ gint r; ui_hub_scheduled_populate(GLOBALS->mainwindow, NULL); ui_hub_spending_populate(GLOBALS->mainwindow, NULL); ui_hub_transaction_populate(data); - + ui_mainwindow_update(GLOBALS->mainwindow, GINT_TO_POINTER(UF_TITLE+UF_SENSITIVE+UF_VISUAL)); } @@ -1427,7 +1427,7 @@ gint r = XML_UNSET; _("If you save it, all the external changes could be lost. Save it anyway?"), _("S_ave Anyway") ); - + if( result != GTK_RESPONSE_OK ) return; } @@ -1491,7 +1491,7 @@ gint flags; #else data->wintitle = g_strdup_printf("%s%s - %s - " PROGNAME, changed, basename, GLOBALS->owner); #endif - + gtk_window_set_title (GTK_WINDOW (gtk_widget_get_ancestor(widget, GTK_TYPE_WINDOW)), data->wintitle); g_free(basename); @@ -1617,7 +1617,7 @@ gint flags; gtk_widget_hide(GTK_WIDGET(data->GR_top)); - + DB( g_print(" - show upcoming=%d\n", PREFS->wal_upcoming) ); if(PREFS->wal_upcoming) gtk_widget_show(GTK_WIDGET(data->GR_upc)); @@ -1729,7 +1729,7 @@ gboolean retval = FALSE; if(PREFS->pnl_list_tab) g_free(PREFS->pnl_list_tab); PREFS->pnl_list_tab = g_strdup(gtk_stack_get_visible_child_name(GTK_STACK(data->stack))); - + //todo if(ui_dialog_msg_savechanges(widget, NULL) == FALSE) { @@ -1744,7 +1744,7 @@ gboolean retval = FALSE; g_free(data->wintitle); da_flt_free(data->filter); g_free(user_data); - + gtk_main_quit(); } @@ -1858,7 +1858,7 @@ gchar **uris, **str; gchar *newseldata; gint n_uris, filetype, slen; GError *error = NULL; - + if (info != TARGET_URI_LIST) return; @@ -1871,7 +1871,7 @@ GError *error = NULL; newseldata[slen] = 0; //DB( g_print(" - seldata ='%s'\n", gtk_selection_data_get_data(selection_data) ) ); //DB( g_print(" - newseldata ='%s'\n", newseldata ) ); - + uris = g_uri_list_extract_uris (newseldata); n_uris = g_strv_length(uris); DB( g_print(" - dragged %d files (len=%d)\n", n_uris, slen ) ); @@ -1880,7 +1880,7 @@ GError *error = NULL; //single file: check for xhb if(n_uris == 1) - { + { filetype = hb_filename_type_get_by_extension(*uris); DB( g_print(" - filetype is homebank (%d)\n", filetype) ); @@ -1913,7 +1913,7 @@ GError *error = NULL; //collect known filetype to import DB( g_print(" - collect %d files\n", n_uris) ); - + gchar **paths = g_new (gchar *, n_uris + 1); slen = 0; for (str = uris; *str; str++) @@ -1928,7 +1928,7 @@ GError *error = NULL; DB( g_print(" - append %d '%s'\n", slen, path ) ); paths[slen++] = path; } - } + } } paths[slen] = NULL; @@ -1936,8 +1936,8 @@ GError *error = NULL; { ui_import_assistant_new( paths ); } - - + + end_drop: g_strfreev (uris); } @@ -2139,7 +2139,7 @@ GtkWidget *bar, *label; gtk_label_set_markup (GTK_LABEL(label), "Unstable Development Version"); gtk_box_pack_start (GTK_BOX (gtk_info_bar_get_content_area (GTK_INFO_BAR (bar))), label, FALSE, FALSE, 0); #endif - + /* Add the main area */ vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); //gtk_container_set_border_width (GTK_CONTAINER(vbox), SPACING_MEDIUM); @@ -2173,7 +2173,7 @@ GtkWidget *bar, *label; gtk_stack_sidebar_set_stack (GTK_STACK_SIDEBAR (sidebar), GTK_STACK (stack)); data->stack = stack; gtk_box_pack_start (GTK_BOX (box), stack, TRUE, TRUE, 0); - + page = ui_hub_scheduled_create(data); gtk_stack_add_titled (GTK_STACK (stack), page, "sched", _("Scheduled")); //gtk_paned_pack2 (GTK_PANED(vpaned), widget, TRUE, FALSE); @@ -2183,7 +2183,7 @@ GtkWidget *bar, *label; page = ui_hub_transaction_create(data, HUB_TXN_TYPE_REMIND); gtk_stack_add_titled (GTK_STACK (stack), page, "remin", _("Remind")); - + //setup, init and show window wg = &PREFS->wal_wg; @@ -2208,7 +2208,7 @@ GtkWidget *bar, *label; if( PREFS->pnl_list_tab != NULL ) gtk_stack_set_visible_child_name (GTK_STACK(data->stack), PREFS->pnl_list_tab); - + //todo: move this elsewhere DB( g_print(" - setup stuff\n") ); diff --git a/src/ext-value.c b/src/ext-value.c index 47c4829..46eab40 100644 --- a/src/ext-value.c +++ b/src/ext-value.c @@ -72,10 +72,10 @@ GValue* EXT_JULIAN(GValue* v, guint32 d) #define obj(CTYPE, _2, _3, _4, PREFIX) \ GType PREFIX##get_type() \ { \ - static GType type = 0; \ - if (type == 0) \ - type = g_pointer_type_register_static(#CTYPE); \ - return type; \ + static GType type = 0; \ + if (type == 0) \ + type = g_pointer_type_register_static(#CTYPE); \ + return type; \ } #include "ext-value.h" #undef obj diff --git a/src/ext.c b/src/ext.c index d652c0e..df7f780 100644 --- a/src/ext.c +++ b/src/ext.c @@ -83,7 +83,7 @@ void ext_register(const gchar* type, engine->unload_plugin = unload_plugin; engine->execute = execute; engine->call_hook = call_hook; - _engine_list = g_list_append(_engine_list, engine); + _engine_list = g_list_append(_engine_list, engine); } diff --git a/src/hb-account.c b/src/hb-account.c index 2ecbb6f..d0c9c78 100644 --- a/src/hb-account.c +++ b/src/hb-account.c @@ -50,9 +50,9 @@ da_acc_free(Account *item) g_free(item->number); g_free(item->bankname); g_free(item->notes); - + g_queue_free (item->txn_queue); - + rc_free(item); } } @@ -238,7 +238,7 @@ gchar *stripname; g_free(stripname); } - return retval; + return retval; } @@ -355,14 +355,14 @@ gboolean retval; while (lnk_acc != NULL) { Account *acc = lnk_acc->data; - + if(acc->key != key) { lnk_txn = g_queue_peek_head_link(acc->txn_queue); while (lnk_txn != NULL) { Transaction *entry = lnk_txn->data; - + if( key == entry->kxferacc) { retval = TRUE; @@ -437,12 +437,12 @@ gchar *stripname = account_get_stripname(newname); g_free(stripname); } - + return FALSE; } -/* +/* * change the account currency * change every txn to currency * ensure dst xfer transaction account will be set to same currency @@ -483,7 +483,7 @@ guint32 maxkey, i; acc->kcur = kcur; DB( g_print(" - '%s'\n", acc->name) ); - + for(i=1;idata; - + /* set initial amount */ acc->bal_bank = acc->initial; acc->bal_today = acc->initial; acc->bal_future = acc->initial; - + /* add every txn */ lnk_txn = g_queue_peek_head_link(acc->txn_queue); while (lnk_txn != NULL) { Transaction *txn = lnk_txn->data; - + if(!(txn->status == TXN_STATUS_REMIND)) { account_balances_add_internal(acc, txn); } lnk_txn = g_list_next(lnk_txn); } - + lnk_acc = g_list_next(lnk_acc); } g_list_free(lst_acc); diff --git a/src/hb-archive.c b/src/hb-archive.c index db3b101..1f65214 100644 --- a/src/hb-archive.c +++ b/src/hb-archive.c @@ -148,10 +148,10 @@ guint32 max_key = 0; { Archive *item = tmplist->data; - max_key = MAX(item->key, max_key); + max_key = MAX(item->key, max_key); tmplist = g_list_next(tmplist); } - + return max_key; } @@ -194,7 +194,7 @@ guint nbsplit; GLOBALS->changes_count++; } - //#1340142 check split category + //#1340142 check split category if( item->splits != NULL ) { nbsplit = da_splits_consistency(item->splits); @@ -206,7 +206,7 @@ guint nbsplit; GLOBALS->changes_count++; } } - + // check payee exists pay = da_pay_get(item->kpay); if(pay == NULL) @@ -256,7 +256,7 @@ Archive *da_archive_init_from_transaction(Archive *arc, Transaction *txn) arc->splits = da_splits_clone(txn->splits); if( da_splits_length (arc->splits) > 0 ) arc->flags |= OF_SPLIT; //Flag that Splits are active - + return arc; } @@ -292,7 +292,7 @@ guint32 nextpostdate = nextdate; /* get the final post date and free */ nextpostdate = g_date_get_julian(tmpdate); - + return nextpostdate; } @@ -320,7 +320,7 @@ gint shift; finalpostdate = postdate; - + tmpdate = g_date_new_julian(finalpostdate); /* manage weekend exception */ if( arc->weekend > 0 ) @@ -347,11 +347,11 @@ gint shift; } } } - + /* get the final post date and free */ finalpostdate = g_date_get_julian(tmpdate); g_date_free(tmpdate); - + return finalpostdate; } @@ -395,10 +395,10 @@ guint32 nblate = 0; if(arc->flags & OF_LIMIT) nblate = MIN(nblate, arc->limit); - + nblate = MIN(nblate, 11); */ - + // pre 5.1 way post_date = g_date_new(); @@ -454,7 +454,7 @@ gushort lastday; } arc->daygap = CLAMP(lastday - g_date_get_day(post_date), 0, 3); - + DB( g_print(" daygap is %d\n", arc->daygap) ); } else @@ -491,10 +491,10 @@ GDate *today, *maxdate; DB( g_print("\n[scheduled] date_get_post_max\n") ); //add until xx of the next month (excluded) - if(GLOBALS->auto_smode == 0) + if(GLOBALS->auto_smode == 0) { DB( g_print(" - max is %d of next month\n", GLOBALS->auto_weekday) ); - + today = g_date_new_julian(GLOBALS->today); //we compute user xx weekday of next month @@ -502,9 +502,9 @@ GDate *today, *maxdate; g_date_set_day(maxdate, GLOBALS->auto_weekday); if(g_date_get_day (today) >= GLOBALS->auto_weekday) g_date_add_months(maxdate, 1); - + nbdays = g_date_days_between(today, maxdate); - + g_date_free(maxdate); g_date_free(today); } @@ -535,7 +535,7 @@ Transaction *txn; maxpostdate = scheduled_date_get_post_max(); txn = da_transaction_malloc(); - + list = g_list_first(GLOBALS->arc_list); while (list != NULL) { @@ -555,7 +555,7 @@ Transaction *txn; while(mydate < maxpostdate) { DB( hb_print_date(mydate, arc->memo) ); - + da_transaction_init_from_template(txn, arc); txn->date = scheduled_get_postdate(arc, mydate); /* todo: ? fill in cheque number */ @@ -581,7 +581,7 @@ nextarchive: } da_transaction_free (txn); - + return count; } diff --git a/src/hb-category.c b/src/hb-category.c index e26b2b8..84a3c40 100644 --- a/src/hb-category.c +++ b/src/hb-category.c @@ -183,7 +183,7 @@ Category *parent; if( parent != NULL ) item->fullname = g_strconcat(parent->name, ":", item->name, NULL); } - + DB( g_print("- updated %d:'%s' fullname='%s'\n", item->key, item->name, item->fullname) ); } @@ -194,23 +194,23 @@ da_cat_rename(Category *item, gchar *newname) { DB( g_print("- renaming %s' => '%s'\n", item->name, newname) ); - + g_free(item->name); item->name = g_strdup(newname); da_cat_build_fullname(item); - + if( item->parent == 0 ) { GHashTableIter iter; gpointer value; DB( g_print("- updating subcat fullname\n") ); - + g_hash_table_iter_init (&iter, GLOBALS->h_cat); while (g_hash_table_iter_next (&iter, NULL, &value)) { Category *subcat = value; - + if( subcat->parent == item->key ) da_cat_build_fullname(subcat); } @@ -235,13 +235,13 @@ guint32 *new_key; DB( g_print("\nda_cat_insert\n") ); DB( g_print("- '%s'\n", item->name) ); - + new_key = g_new0(guint32, 1); *new_key = item->key; g_hash_table_insert(GLOBALS->h_cat, new_key, item); da_cat_build_fullname(item); - + return TRUE; } @@ -264,7 +264,7 @@ Category *existitem; if( !cat->fullname ) da_cat_build_fullname(cat); - + existitem = da_cat_get_by_fullname( cat->fullname ); if( existitem == NULL ) { @@ -324,7 +324,7 @@ gboolean valid = TRUE; if( outlen != NULL ) *outlen = len; - + if(len >= 1) { g_strstrip(partstr[0]); @@ -356,7 +356,7 @@ gchar **partstr; Category *parent = NULL; Category *retval = NULL; guint len; - + DB( g_print("\nda_cat_get_by_fullname\n") ); if( rawfullname ) @@ -368,7 +368,7 @@ guint len; parent = da_cat_get_by_name_find_internal(0, partstr[0]); retval = parent; } - + if( len == 2 && parent != NULL ) { retval = da_cat_get_by_name_find_internal(parent->key, partstr[1]); @@ -377,7 +377,7 @@ guint len; g_strfreev(partstr); } } - + return retval; } @@ -417,7 +417,7 @@ guint len; } retval = parent; } - + /* if we have a subcategory - xxx:xxx */ if( len == 2 && parent != NULL ) { @@ -436,7 +436,7 @@ guint len; } retval = newcat; } - + g_strfreev(partstr); } } @@ -511,7 +511,7 @@ gboolean isIncome; g_warning("category consistency: fixed null name"); GLOBALS->changes_count++; } - + } @@ -568,11 +568,11 @@ guint32 retval = 0; } -void +void category_delete_unused(void) { GList *lcat, *list; - + lcat = list = g_hash_table_get_values(GLOBALS->h_cat); while (list != NULL) { @@ -587,7 +587,7 @@ GList *lcat, *list; } -static void +static void category_fill_usage_count(guint32 kcat) { Category *cat = da_cat_get (kcat); @@ -645,12 +645,12 @@ guint i, nbsplit; for(i=0;isplits, i); - + category_fill_usage_count(split->kcat); } } else - category_fill_usage_count(txn->kcat); + category_fill_usage_count(txn->kcat); lnk_txn = g_list_next(lnk_txn); } @@ -681,7 +681,7 @@ guint i, nbsplit; for(i=0;isplits, i); - + category_fill_usage_count(split->kcat); } } @@ -723,7 +723,7 @@ guint i, nbsplit; while (lnk_txn != NULL) { Transaction *txn = lnk_txn->data; - + if(txn->kcat == key1) { txn->kcat = key2; @@ -745,7 +745,7 @@ guint i, nbsplit; lnk_txn = g_list_next(lnk_txn); } - + lnk_acc = g_list_next(lnk_acc); } g_list_free(lst_acc); @@ -1067,7 +1067,7 @@ category_get_type_char(Category *item) } -static gint +static gint category_change_type_eval(Category *item, gboolean isIncome) { if( (item->flags & (GF_INCOME)) && !isIncome ) @@ -1076,14 +1076,14 @@ category_change_type_eval(Category *item, gboolean isIncome) } -gint +gint category_change_type(Category *item, gboolean isIncome) { gint changes = 0; GList *lcat, *list; changes += category_change_type_eval(item, isIncome); - + item->flags &= ~(GF_INCOME); //delete flag if(isIncome == TRUE) item->flags |= GF_INCOME; diff --git a/src/ui-pref.c b/src/ui-pref.c index 322358e..3ff2dd4 100644 --- a/src/ui-pref.c +++ b/src/ui-pref.c @@ -68,7 +68,7 @@ static gchar *pref_iconname[PREF_MAX] = { "prf-interface", "prf-locale", "prf-columns", -//"prf-display", +//"prf-display", "prf-import", "prf-report", "prf-backup", @@ -209,9 +209,9 @@ static void list_ext_colpref_get(GtkTreeView *treeview, GList **columns); static LangName languagenames[] = { -// af ar ast be bg ca cs cy da de el en_AU en_CA en_GB es et eu fa fi fr ga gl he hr hu id is it +// af ar ast be bg ca cs cy da de el en_AU en_CA en_GB es et eu fa fi fr ga gl he hr hu id is it //ja ka ko lt lv ms nb nds nl oc pl pt_BR pt pt_PT ro ru si sk sl sr sv tr uk vi zh_CN zh_TW - + { "aa", "Afar" }, { "ab", "Abkhazian" }, { "ae", "Avestan" }, @@ -419,7 +419,7 @@ gchar *name1, *name2; //keep system laguage on top if(code1 == NULL) name1 = NULL; if(code2 == NULL) name2 = NULL; - + retval = hb_string_utf8_compare(name1, name2); g_free(name2); @@ -468,7 +468,7 @@ const gchar *lang; g_warning(" locale name not found '%s'", locale); lang = locale; } - + } return lang; @@ -483,7 +483,7 @@ GtkTreeIter iter; model = gtk_combo_box_get_model(GTK_COMBO_BOX(combobox)); gtk_list_store_append (GTK_LIST_STORE(model), &iter); - gtk_list_store_set (GTK_LIST_STORE(model), &iter, + gtk_list_store_set (GTK_LIST_STORE(model), &iter, 0, NULL, 1, _("System Language"), -1); @@ -506,13 +506,13 @@ const gchar *dirname; { const gchar *lang; gchar *label; - + gtk_list_store_append (GTK_LIST_STORE(model), &iter); lang = ui_language_combobox_get_name(dirname); label = g_strdup_printf ("%s [%s]", lang, dirname); - gtk_list_store_set (GTK_LIST_STORE(model), &iter, + gtk_list_store_set (GTK_LIST_STORE(model), &iter, 0, dirname, 1, label, -1); @@ -549,7 +549,7 @@ GtkCellRenderer *renderer; gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (combobox), renderer, "text", 1, NULL); gtk_combo_box_set_id_column( GTK_COMBO_BOX(combobox), 0); - + g_object_unref(store); if(label) @@ -558,7 +558,7 @@ GtkCellRenderer *renderer; ui_language_combobox_populate(combobox); gtk_combo_box_set_active(GTK_COMBO_BOX(combobox), 0); - + return combobox; } @@ -726,7 +726,7 @@ gchar buf[128]; cur.frac_digits = gtk_spin_button_get_value(GTK_SPIN_BUTTON(data->NB_euro_fracdigits)); da_cur_initformat (&cur); - + DB( g_print("fmt: %s\n", cur.format) ); g_ascii_formatd(formatd_buf, sizeof (formatd_buf), cur.format, HB_NUMBER_SAMPLE); @@ -766,11 +766,11 @@ struct defpref_data *data; EuroParams *euro; gchar *buf; gint active; - + DB( g_print("\n[ui-pref] eurosetcurrency\n") ); data = g_object_get_data(G_OBJECT(gtk_widget_get_ancestor(widget, GTK_TYPE_WINDOW)), "inst_data"); - + active = ui_euro_combobox_id_to_active(country); euro = &euro_params[active]; buf = g_strdup_printf("%s - %s", euro->iso, euro->name); @@ -903,7 +903,7 @@ struct defpref_data *data; data = g_object_get_data(G_OBJECT(gtk_widget_get_ancestor(widget, GTK_TYPE_WINDOW)), "inst_data"); gtk_widget_queue_draw (data->DA_colors); - + } @@ -1059,7 +1059,7 @@ const gchar *lang; { PREFS->language = g_strdup(lang); } - + PREFS->toolbar_style = gtk_combo_box_get_active(GTK_COMBO_BOX(data->CY_toolbar)); //PREFS->image_size = gtk_spin_button_get_value(GTK_SPIN_BUTTON(data->NB_image_size)); @@ -1077,7 +1077,7 @@ const gchar *lang; PREFS->grid_lines = gtk_combo_box_get_active(GTK_COMBO_BOX(data->CY_gridlines)); //list_txn_colpref_get(GTK_TREE_VIEW(data->LV_opecolumns), PREFS->lst_ope_columns); - // transaction + // transaction PREFS->date_range_txn = hbtk_combo_box_get_active_id(GTK_COMBO_BOX_TEXT(data->CY_daterange_txn)); PREFS->date_future_nbdays = gtk_spin_button_get_value(GTK_SPIN_BUTTON(data->ST_datefuture_nbdays)); PREFS->hidereconciled = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(data->CM_hide_reconciled)); @@ -1101,7 +1101,7 @@ const gchar *lang; PREFS->dtex_qifswap = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(data->CM_dtex_qifswap)); ui_gtk_entry_replace_text(data->ST_path_import, &PREFS->path_import); ui_gtk_entry_replace_text(data->ST_path_export, &PREFS->path_export); - PREFS->dtex_csvsep = gtk_combo_box_get_active(GTK_COMBO_BOX(data->CY_dtex_csvsep)); + PREFS->dtex_csvsep = gtk_combo_box_get_active(GTK_COMBO_BOX(data->CY_dtex_csvsep)); // report PREFS->date_range_rep = hbtk_combo_box_get_active_id(GTK_COMBO_BOX_TEXT(data->CY_daterange_rep)); @@ -1144,10 +1144,10 @@ gint crow, row; gtk_grid_set_row_spacing (GTK_GRID (group_grid), SPACING_SMALL); gtk_grid_set_column_spacing (GTK_GRID (group_grid), SPACING_MEDIUM); gtk_grid_attach (GTK_GRID (content_grid), group_grid, 0, crow++, 1, 1); - + label = make_label_group(_("General options")); gtk_grid_attach (GTK_GRID (group_grid), label, 0, 0, 3, 1); - + row = 1; label = make_label_widget(_("Date order:")); //----------------------------------------- l, r, t, b @@ -1161,17 +1161,17 @@ gint crow, row; widget = gtk_check_button_new_with_mnemonic (_("Sentence _case memo/payee")); data->CM_dtex_ucfirst = widget; gtk_grid_attach (GTK_GRID (group_grid), widget, 1, row, 2, 1); - + // group :: OFX/QFX options group_grid = gtk_grid_new (); gtk_grid_set_row_spacing (GTK_GRID (group_grid), SPACING_SMALL); gtk_grid_set_column_spacing (GTK_GRID (group_grid), SPACING_MEDIUM); gtk_grid_attach (GTK_GRID (content_grid), group_grid, 0, crow++, 1, 1); - + label = make_label_group(_("OFX/QFX options")); gtk_grid_attach (GTK_GRID (group_grid), label, 0, 0, 3, 1); - + row = 1; label = make_label_widget(_("OFX _Name:")); //----------------------------------------- l, r, t, b @@ -1195,10 +1195,10 @@ gint crow, row; gtk_grid_set_row_spacing (GTK_GRID (group_grid), SPACING_SMALL); gtk_grid_set_column_spacing (GTK_GRID (group_grid), SPACING_MEDIUM); gtk_grid_attach (GTK_GRID (content_grid), group_grid, 0, crow++, 1, 1); - + label = make_label_group(_("QIF options")); gtk_grid_attach (GTK_GRID (group_grid), label, 0, 0, 3, 1); - + row = 1; widget = gtk_check_button_new_with_mnemonic (_("_Import memos")); data->CM_dtex_qifmemo = widget; @@ -1212,7 +1212,7 @@ gint crow, row; gtk_grid_set_row_spacing (GTK_GRID (group_grid), SPACING_SMALL); gtk_grid_set_column_spacing (GTK_GRID (group_grid), SPACING_MEDIUM); gtk_grid_attach (GTK_GRID (content_grid), group_grid, 0, crow++, 1, 1); - + label = make_label_group(_("CSV options")); gtk_grid_attach (GTK_GRID (group_grid), label, 0, 0, 3, 1); @@ -1247,7 +1247,7 @@ gint i, x, y; index = gtk_combo_box_get_active(GTK_COMBO_BOX(data->CY_color_scheme)); colorscheme_init(&scheme, index); - + gtk_widget_get_size_request (widget, &w, &h); x = y = 0; for(i=0;iCM_stat_byamount = widget; @@ -1348,10 +1348,10 @@ gint crow, row; gtk_grid_set_row_spacing (GTK_GRID (group_grid), SPACING_SMALL); gtk_grid_set_column_spacing (GTK_GRID (group_grid), SPACING_MEDIUM); gtk_grid_attach (GTK_GRID (content_grid), group_grid, 0, crow++, 1, 1); - + label = make_label_group(_("Budget options")); gtk_grid_attach (GTK_GRID (group_grid), label, 0, 0, 3, 1); - + row = 1; widget = gtk_check_button_new_with_mnemonic (_("Show _details")); data->CM_budg_showdetail = widget; @@ -1376,7 +1376,7 @@ gint crow, row; gtk_grid_set_row_spacing (GTK_GRID (group_grid), SPACING_SMALL); gtk_grid_set_column_spacing (GTK_GRID (group_grid), SPACING_MEDIUM); gtk_grid_attach (GTK_GRID (content_grid), group_grid, 0, crow++, 1, 1); - + label = make_label_group(_("General")); gtk_grid_attach (GTK_GRID (group_grid), label, 0, 0, 3, 1); @@ -1391,7 +1391,7 @@ gint crow, row; gtk_grid_set_row_spacing (GTK_GRID (group_grid), SPACING_SMALL); gtk_grid_set_column_spacing (GTK_GRID (group_grid), SPACING_MEDIUM); gtk_grid_attach (GTK_GRID (content_grid), group_grid, 0, crow++, 1, 1); - + label = make_label_group(_("Currency")); gtk_grid_attach (GTK_GRID (group_grid), label, 0, 0, 4, 1); @@ -1411,7 +1411,7 @@ gint crow, row; //gtk_grid_attach (GTK_GRID (group_grid), data->CY_option[FILTER_DATE], 1, 2, row, row+1); gtk_grid_attach (GTK_GRID (group_grid), widget, 3, row, 1, 1); - + // group :: Exchange rate group_grid = gtk_grid_new (); data->GRP_rate = group_grid; @@ -1436,7 +1436,7 @@ gint crow, row; gtk_grid_set_row_spacing (GTK_GRID (group_grid), SPACING_SMALL); gtk_grid_set_column_spacing (GTK_GRID (group_grid), SPACING_MEDIUM); gtk_grid_attach (GTK_GRID (content_grid), group_grid, 0, crow++, 1, 1); - + label = make_label_group(_("Format")); gtk_grid_attach (GTK_GRID (group_grid), label, 0, 0, 3, 1); @@ -1453,7 +1453,7 @@ gint crow, row; gtk_grid_set_row_spacing (GTK_GRID (group_grid), SPACING_SMALL); gtk_grid_set_column_spacing (GTK_GRID (group_grid), SPACING_MEDIUM); gtk_container_add (GTK_CONTAINER (expander), group_grid); - + row = 0; label = make_label_widget(_("_Symbol:")); gtk_grid_attach (GTK_GRID (group_grid), label, 1, row, 1, 1); @@ -1506,7 +1506,7 @@ gint crow, row; gtk_grid_set_row_spacing (GTK_GRID (group_grid), SPACING_SMALL); gtk_grid_set_column_spacing (GTK_GRID (group_grid), SPACING_MEDIUM); gtk_grid_attach (GTK_GRID (content_grid), group_grid, 0, crow++, 1, 1); - + label = make_label_group(_("User interface")); gtk_grid_attach (GTK_GRID (group_grid), label, 0, 0, 3, 1); @@ -1546,7 +1546,7 @@ gint crow, row; widget = gtk_image_new_from_icon_name (ICONNAME_INFO, GTK_ICON_SIZE_BUTTON); gtk_grid_attach (GTK_GRID (group_grid), widget, 3, row, 1, 1); - + gtk_widget_set_tooltip_text(widget, _("%a locale's abbreviated weekday name.\n" "%A locale's full weekday name. \n" @@ -1602,7 +1602,7 @@ gint crow, row; gtk_grid_set_row_spacing (GTK_GRID (group_grid), SPACING_SMALL); gtk_grid_set_column_spacing (GTK_GRID (group_grid), SPACING_MEDIUM); gtk_grid_attach (GTK_GRID (content_grid), group_grid, 0, crow++, 1, 1); - + label = make_label_group(_("Measurement units")); gtk_grid_attach (GTK_GRID (group_grid), label, 0, 0, 3, 1); @@ -1635,7 +1635,7 @@ gint crow, row; gtk_grid_set_row_spacing (GTK_GRID (group_grid), SPACING_SMALL); gtk_grid_set_column_spacing (GTK_GRID (group_grid), SPACING_MEDIUM); gtk_grid_attach (GTK_GRID (content_grid), group_grid, 0, crow++, 1, 1); - + label = make_label_group(_("Transaction window")); gtk_grid_attach (GTK_GRID (group_grid), label, 0, 0, 3, 1); @@ -1652,7 +1652,7 @@ gint crow, row; //----------------------------------------- l, r, t, b gtk_grid_attach (GTK_GRID (group_grid), label, 1, row, 1, 1); widget = make_numeric(NULL, 0, 366); - + data->ST_datefuture_nbdays = widget; gtk_grid_attach (GTK_GRID (group_grid), widget, 2, row, 1, 1); @@ -1675,7 +1675,7 @@ gint crow, row; gtk_grid_set_row_spacing (GTK_GRID (group_grid), SPACING_SMALL); gtk_grid_set_column_spacing (GTK_GRID (group_grid), SPACING_MEDIUM); gtk_grid_attach (GTK_GRID (content_grid), group_grid, 0, crow++, 1, 1); - + label = make_label_group(_("Multiple add")); gtk_grid_attach (GTK_GRID (group_grid), label, 0, 0, 3, 1); @@ -1689,7 +1689,7 @@ gint crow, row; gtk_grid_set_row_spacing (GTK_GRID (group_grid), SPACING_SMALL); gtk_grid_set_column_spacing (GTK_GRID (group_grid), SPACING_MEDIUM); gtk_grid_attach (GTK_GRID (content_grid), group_grid, 0, crow++, 1, 1); - + label = make_label_group(_("Memo autocomplete")); gtk_grid_attach (GTK_GRID (group_grid), label, 0, 0, 3, 1); @@ -1711,7 +1711,7 @@ gint crow, row; gtk_grid_set_row_spacing (GTK_GRID (group_grid), SPACING_SMALL); gtk_grid_set_column_spacing (GTK_GRID (group_grid), SPACING_MEDIUM); gtk_grid_attach (GTK_GRID (content_grid), group_grid, 0, crow++, 1, 1); - + label = make_label_group(_("Column list")); gtk_grid_attach (GTK_GRID (group_grid), label, 0, 0, 3, 1); @@ -1748,7 +1748,7 @@ gint crow, row; gtk_grid_set_row_spacing (GTK_GRID (group_grid), SPACING_SMALL); gtk_grid_set_column_spacing (GTK_GRID (group_grid), SPACING_MEDIUM); gtk_grid_attach (GTK_GRID (content_grid), group_grid, 0, crow++, 1, 1); - + label = make_label_group(_("General")); gtk_grid_attach (GTK_GRID (group_grid), label, 0, 0, 3, 1); @@ -1780,7 +1780,7 @@ gint crow, row; gtk_grid_set_row_spacing (GTK_GRID (group_grid), SPACING_SMALL); gtk_grid_set_column_spacing (GTK_GRID (group_grid), SPACING_MEDIUM); gtk_grid_attach (GTK_GRID (content_grid), group_grid, 0, crow++, 1, 1); - + label = make_label_group(_("Amount colors")); gtk_grid_attach (GTK_GRID (group_grid), label, 0, 0, 3, 1); @@ -1807,11 +1807,11 @@ gint crow, row; hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, SPACING_SMALL); data->GR_colors = hbox; gtk_grid_attach (GTK_GRID (group_grid), hbox, 2, row, 1, 1); - + widget = gtk_color_button_new (); data->CP_exp_color = widget; gtk_box_pack_start (GTK_BOX (hbox), widget, FALSE, FALSE, 0); - + label = make_label_widget(_("_Income:")); gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); @@ -1845,7 +1845,7 @@ gint crow, row; gtk_grid_set_row_spacing (GTK_GRID (group_grid), SPACING_SMALL); gtk_grid_set_column_spacing (GTK_GRID (group_grid), SPACING_MEDIUM); gtk_grid_attach (GTK_GRID (content_grid), group_grid, 0, crow++, 1, 1); - + label = make_label_group(_("Backup")); gtk_grid_attach (GTK_GRID (group_grid), label, 0, 0, 3, 1); @@ -1893,7 +1893,7 @@ gint crow, row; gtk_grid_set_row_spacing (GTK_GRID (group_grid), SPACING_SMALL); gtk_grid_set_column_spacing (GTK_GRID (group_grid), SPACING_MEDIUM); gtk_grid_attach (GTK_GRID (content_grid), group_grid, 0, crow++, 1, 1); - + label = make_label_group(_("HomeBank files")); gtk_grid_attach (GTK_GRID (group_grid), label, 0, 0, 3, 1); @@ -1921,10 +1921,10 @@ gint crow, row; gtk_grid_set_row_spacing (GTK_GRID (group_grid), SPACING_SMALL); gtk_grid_set_column_spacing (GTK_GRID (group_grid), SPACING_MEDIUM); gtk_grid_attach (GTK_GRID (content_grid), group_grid, 0, crow++, 1, 1); - + label = make_label_group(_("Exchange files")); gtk_grid_attach (GTK_GRID (group_grid), label, 0, 0, 3, 1); - + row = 1; label = make_label_widget(_("_Import:")); //----------------------------------------- l, r, t, b @@ -1984,7 +1984,7 @@ gint crow, row; gtk_grid_set_row_spacing (GTK_GRID (group_grid), SPACING_SMALL); gtk_grid_set_column_spacing (GTK_GRID (group_grid), SPACING_MEDIUM); gtk_grid_attach (GTK_GRID (content_grid), group_grid, 0, crow++, 1, 1); - + label = make_label_group(_("Program start")); gtk_grid_attach (GTK_GRID (group_grid), label, 0, 0, 3, 1); @@ -2014,7 +2014,7 @@ gint crow, row; gtk_grid_set_row_spacing (GTK_GRID (group_grid), SPACING_SMALL); gtk_grid_set_column_spacing (GTK_GRID (group_grid), SPACING_MEDIUM); gtk_grid_attach (GTK_GRID (content_grid), group_grid, 0, crow++, 1, 1); - + label = make_label_group(_("Main window reports")); gtk_grid_attach (GTK_GRID (group_grid), label, 0, 0, 3, 1); @@ -2318,7 +2318,7 @@ gint result; homebank_pref_setdefault(); defpref_set(data); } - + } @@ -2341,7 +2341,7 @@ GtkWidget *hbox, *vbox, *sw, *widget, *notebook, *page, *ebox, *image, *label; NULL); data.window = window; - + //store our window private data g_object_set_data(G_OBJECT(window), "inst_data", (gpointer)&data); @@ -2359,7 +2359,7 @@ GtkWidget *hbox, *vbox, *sw, *widget, *notebook, *page, *ebox, *image, *label; //left part vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, SPACING_SMALL); gtk_box_pack_start (GTK_BOX (hbox), vbox, FALSE, FALSE, 0); - + //list sw = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (sw), GTK_SHADOW_ETCHED_IN); @@ -2384,11 +2384,11 @@ GtkWidget *hbox, *vbox, *sw, *widget, *notebook, *page, *ebox, *image, *label; #else GtkCssProvider *provider; provider = gtk_css_provider_new (); - gtk_css_provider_load_from_data (provider, + gtk_css_provider_load_from_data (provider, "#hbebox { color: @theme_selected_fg_color; background-color: @theme_selected_bg_color; }" , -1, NULL); gtk_style_context_add_provider (context, GTK_STYLE_PROVIDER(provider), G_MAXUINT); - + // gtk_style_context_set_state(context, GTK_STATE_FLAG_SELECTED); #endif @@ -2488,7 +2488,7 @@ GtkWidget *hbox, *vbox, *sw, *widget, *notebook, *page, *ebox, *image, *label; g_signal_connect (data.CM_bak_is_automatic, "toggled", G_CALLBACK (defpref_backuptoggle), NULL); - + //path selector g_signal_connect (data.BT_path_hbfile, "pressed", G_CALLBACK (defpref_pathselect), GINT_TO_POINTER(PRF_PATH_WALLET)); g_signal_connect (data.BT_path_import, "pressed", G_CALLBACK (defpref_pathselect), GINT_TO_POINTER(PRF_PATH_IMPORT)); @@ -2498,7 +2498,7 @@ GtkWidget *hbox, *vbox, *sw, *widget, *notebook, *page, *ebox, *image, *label; g_signal_connect (data.CY_colors, "changed", G_CALLBACK (defpref_colorpreset), NULL); - + g_signal_connect (gtk_tree_view_get_selection(GTK_TREE_VIEW(data.LV_page)), "changed", G_CALLBACK (defpref_selection), notebook); g_signal_connect (data.CM_euro_enable, "toggled", G_CALLBACK (defpref_eurotoggle), NULL); @@ -2534,10 +2534,9 @@ GtkWidget *hbox, *vbox, *sw, *widget, *notebook, *page, *ebox, *image, *label; gtk_window_resize(GTK_WINDOW(window), 640, 256); - //select first row + //select initial row GtkTreePath *path = gtk_tree_path_new_from_indices(initial_selection, -1); - gtk_tree_selection_select_path (gtk_tree_view_get_selection(GTK_TREE_VIEW(data.LV_page)), path); @@ -2563,14 +2562,14 @@ GtkWidget *hbox, *vbox, *sw, *widget, *notebook, *page, *ebox, *image, *label; ui_mainwindow_update(GLOBALS->mainwindow, GINT_TO_POINTER(UF_BALANCE+UF_VISUAL)); DB( g_print("old='%s' new='%s'\n", old_lang, PREFS->language) ); - + if(g_ascii_strncasecmp(old_lang == NULL ? "" : old_lang, PREFS->language == NULL ? "" : PREFS->language, -1) != 0) { ui_dialog_msg_infoerror(GTK_WINDOW(window), GTK_MESSAGE_INFO, _("Info"), _("You will have to restart HomeBank\nfor the language change to take effect.") ); - + } g_free(old_lang); @@ -2580,7 +2579,7 @@ GtkWidget *hbox, *vbox, *sw, *widget, *notebook, *page, *ebox, *image, *label; defpref_reset (window, NULL); break; } - + // cleanup and destroy //defhbfile_cleanup(&data, result); @@ -2661,7 +2660,7 @@ GtkTreeIter iter; GtkTreePath *path = gtk_tree_path_new_from_string (path_str); gboolean fixed; - // get toggled iter + // get toggled iter gtk_tree_model_get_iter (model, &iter, path); gtk_tree_model_get (model, &iter, COLUMN_VISIBLE, &fixed, -1); @@ -2685,7 +2684,7 @@ gboolean visible; gint i, id; DB( g_print("[lst_txn-colpref] store column order \n") ); - + model = gtk_tree_view_get_model(GTK_TREE_VIEW(treeview)); valid = gtk_tree_model_get_iter_first(GTK_TREE_MODEL(model), &iter); i = 0; @@ -2734,16 +2733,16 @@ gint i; gboolean visible; DB( g_print("eval %d, %s\n", i, list_txn_column_label[i]) ); - + if(i <= LST_DSPOPE_DATE) // status, date always displayed continue; //[i-1] here because lst_ope_columns[] do not store MODEL_TXN_POINTER - id = ABS(PREFS->lst_ope_columns[i-1]); + id = ABS(PREFS->lst_ope_columns[i-1]); if(id == 0) id = i; //if we pass here, new column or weird into pref file visible = (PREFS->lst_ope_columns[i-1] > 0) ? TRUE : FALSE; - + DB( g_print(" - pos=%2d, id=%2d - %d '%s'\n", i, id, visible, list_txn_column_label[id]) ); gtk_list_store_append (store, &iter); @@ -2752,7 +2751,7 @@ gint i; COLUMN_NAME, _(list_txn_column_label[id]), COLUMN_ID , id, -1); - + } //treeview @@ -2771,7 +2770,7 @@ gint i; g_signal_connect (renderer, "toggled", G_CALLBACK (list_txn_colpref_toggled_cell_data_function), store); - + renderer = gtk_cell_renderer_text_new (); column = gtk_tree_view_column_new_with_attributes (_("Column"), renderer, diff --git a/src/ui-pref.h b/src/ui-pref.h index 524c6ad..ec6fc2e 100644 --- a/src/ui-pref.h +++ b/src/ui-pref.h @@ -67,7 +67,7 @@ struct defpref_data GtkWidget *BT_go_up; GtkWidget *BT_go_down; - + GtkWidget *CM_runwizard; GtkWidget *ST_path_import, *BT_path_import; @@ -88,24 +88,24 @@ struct defpref_data GtkWidget *CY_daterange_txn; GtkWidget *ST_datefuture_nbdays; GtkWidget *CY_daterange_rep; - + /* currencies */ GtkWidget *LB_default; - GtkWidget *BT_default; - + GtkWidget *BT_default; + GtkWidget *CM_euro_enable; GtkWidget *GRP_currency; GtkWidget *GRP_rate; GtkWidget *GRP_format; - + GtkWidget *CY_euro_preset; GtkWidget *ST_euro_country; GtkWidget *NB_euro_value; GtkWidget *ST_euro_symbol; GtkWidget *CM_euro_isprefix; - GtkWidget *ST_euro_decimalchar; - GtkWidget *ST_euro_groupingchar; + GtkWidget *ST_euro_decimalchar; + GtkWidget *ST_euro_groupingchar; GtkWidget *NB_euro_fracdigits; GtkWidget *LB_numbereuro; @@ -152,8 +152,7 @@ enum PREF_MAX }; - -typedef struct +typedef struct { gchar *locale; gchar *name;