gnucash Überweisungsvorlagen

Christian Stimming stimming at tuhh.de
Wed Feb 25 02:34:04 CST 2004


Hallo Bernd,

(for the english mailing list subscribers: This is an improvement patch 
for some HBCI features. I'll have a look at it during the next days.)

besten Dank für das patch. Ich bin im Moment mit anderen Dingen schwer 
beschäftigt, aber ich werde mich am Wochenende oder spätestens nächste 
Woche genauer damit beschäftigen. Ich nehm das gerne ins CVS mit rein.

Wie du schon richtig erkannt hast, kann man für po files eigentlich kein 
patch erstellen. Man sollte dann entweder das ganze file einschicken, 
oder, da es hier eh nur um vier Einträge geht, erstmal abwarten bis vor 
dem nächsten Release die vollständige Übersetzung wieder benötigt wird.

Es gibt IIRC an dieser Stelle praktisch keinen Unterschied zwischen 
1.8.7 und 1.8.8. Da sollte also kein Problem auftreten.

Gruß

Christian

Bernd Wagner schrieb:
> Hallo Christian,
> 
> anbei die diff-Files für meine Ergänzungen für gnucash  für die 
> Überweisungsvorlagen.
> 
> Funktionalitäten:
> - Implementierung als GTKList (für eine größere Anzahl von 
> Überweisungsvorlagen),
> - Hinzufügen einer Vorlage wie bisher, ggfs. Einsortieren hinter einer 
> selektierten Vorlage,
> - Sortieren der Liste der Vorlagen lokal (Auf-, Ab-Button) und Sortieren 
> der ganzen Liste,
> - Löschen einer Vorlage.
> 
> Die patch-Files beziehen sich auf die stable-Version 1.8.8. Ausprobiert 
> habe ich die Änderungen bisher nur unter Version 1.8.7. Wie man für 
> .po-Files am sinnvollsten ein handliches Patch-File macht, habe ich 
> nicht rausbekommen (wegen der stark wechselhaften Bezüge auf 
> Quell-Zeilen)  - es sind aber nur vier  Einträge.
> 
> Die Patch-Files sind von Hand erstellt, nicht mit dem Skript.
> 
> Es tut mir leid, dass ich die Sachen nur schwach getestet ausliefere - 
> ich habe nicht oft genügend zusammenhängende Freizeit übrig, um daran zu 
> gehen. Jetzt ist das verlängerte Karnevalswochenende zu Ende und ich 
> möchte auch nicht auf den Sachen sitzenbleiben, bis ich wieder mal dazu 
> komme ...
> 
> Unabhängig davon, was du jetzt mit den Patches weiter anstellst, werde 
> ich bei mir , wenn ich dazu komme, Version 1.8.8 damit zum Laufen 
> bringen und die Patches im eigenen Gebrauch praktisch erproben. Ich 
> weiss halt nicht, wie bald das geht. Natürlich wäre ich froh, wenn du 
> die Änderungen ins CVS stellen würdest.
> 
> Viele Grüße
> 
> Bernd Wagner
> 
> Christian Stimming schrieb:
> 
>> Bernd Wagner schrieb:
>>
>>> vor drei Monaten habe ich mal angefangen und auf Basis von gnucash 
>>> 1.8.7 eine Scrollbox (für eine größere Anzahl von 
>>> Überweisungsvorlagen) und einen Löschbutton realisiert. Bislang habe 
>>> ich noch nicht wieder Zeit gefunden, weiterzumachen.
>>
>>
>>
>> Klasse, klingt gut.
>>
>>> Was müsste ich tun, um das der Allgemeinheit zur Verfügung zu stellen?
>>
>>
>>
>> Du musst ein diff bzw. patch erstellen. Hinweise dazu in der Datei 
>> HACKING. Das diff dann an gnucash-patches einschicken und ggf. CC an 
>> mich. Ich werd das dann durchsehen und entweder Rückfragen stellen 
>> oder das ganze relativ bald ins CVS stellen.
>>
>>> Muss ich mich dazu mit der Realisierung von Mehrsprachigkeit für die 
>>> Buttons und Aufschriften auseinandersetzen?
>>
>>
>>
>> Ja, das wäre gut, aber es ist nicht schwierig: Strings im C-Quellcode 
>> müssen halt auf Englisch sein und ins Makro _("") eingeschlossen sein. 
>> Strings in glade müssen halt einfach auf Englisch sein. Sodann gehst 
>> du ins Verzeichnis po/, machst "rm gnucash.pot; make gnucash.pot" und 
>> kannst schon sehen, daß dein string im gnucash.pot auftaucht. Nun noch 
>> die deutsche Übersetzung: "make de.po" (oder der passende Aufruf von 
>> "msgmerge", siehe dessen manpage), sodann die Datei "de.po" per Hand 
>> editieren und zwar bei den von dir neu eingefügten strings halt eine 
>> Übersetzung hinzufügen. Anschließend "make install", was bereits alle 
>> notwendigen Zusatz-Schritte schon abhandelt.
>>
>> Falls du da partout nicht zu kommst, kannst du auch Code mit deutschen 
>> strings auf gnucash-patches einschicken, aber dann dauert die 
>> Durchsicht und Korrektur von mir entsprechend länger -- oder kann das 
>> schon jemand anderes machen? Um so schneller ist es fertig. Einfach 
>> kurz Bescheid sagen.
>>
>> Gruß
>>
>> Christian
>>
>>>
>>> Freundliche Grüße
>>>
>>> Bernd Wagner
>>>
>>> Christian Stimming schrieb:
>>>
>>>>
>>>> On Freitag, 23. Januar 2004 10:35, Jens Falk wrote:
>>>>
>>>>> Hallo,
>>>>>
>>>>> wie und wo werden die angelegten Überweisungsvorlagen bearbeitet? 
>>>>> Löschen,
>>>>> ändern usw.
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> In gnucash selber ist das Bearbeiten leider weiterhin nicht 
>>>> eingebaut. Man kann sich behelfen, indem man die gnucash-Datei mit 
>>>> einem Texteditor öffnet und nach der Zeile mit 
>>>> <slot:key>template-list</slot:key> sucht. Sodann kann man die 
>>>> Einträge dort entsprechend ändern.
>>>>
>>>> Christian
>>>
>>>
>>>
>>>
>>>
>>
>>
> 
> 
> ------------------------------------------------------------------------
> 
> diff -Naur gnucash-1.8.8-original/src/import-export/hbci/dialog-hbcitrans.c gnucash-1.8.8-20040223/src/import-export/hbci/dialog-hbcitrans.c
> --- gnucash-1.8.8-original/src/import-export/hbci/dialog-hbcitrans.c	2003-11-16 03:24:24.000000000 +0100
> +++ gnucash-1.8.8-20040223/src/import-export/hbci/dialog-hbcitrans.c	2004-02-23 16:59:13.000000000 +0100
> @@ -1,6 +1,8 @@
>  /********************************************************************\
>   * dialog-hbcitrans.c -- dialog for hbci transaction                *
>   * Copyright (C) 2002 Christian Stimming                            *
> + * Copyright (C) 2004 Bernd Wagner (changes for                     *
> + *                     online transaction templates)                *
>   *                                                                  *
>   * This program is free software; you can redistribute it and/or    *
>   * modify it under the terms of the GNU General Public License as   *
> @@ -68,12 +70,18 @@
>    /* Recipient's bank name (may be filled in automatically sometime later) */
>    GtkWidget *recp_bankname_label;
>  
> -  /* The template choosing option menu */
> -  GtkWidget *template_option;
> +  /* The template choosing GtkList */
> +  GtkWidget *template_gtk_list;
>  
> +  /* The selected template in the list */
> +  GtkWidget *selected_template;
> +  
>    /* GList of GNCTransTempl */
>    GList *templ;
>  
> +  /* Flag, if template list has been changed */
> +  gboolean templ_changed;
> +  
>    /* The HBCI transaction that got created here */
>    HBCI_Transaction *hbci_trans;
>    
> @@ -99,6 +107,8 @@
>    if (td->hbci_trans)
>      HBCI_Transaction_delete (td->hbci_trans);
>  
> +  td->selected_template = NULL;
> +    
>    gtk_widget_destroy (GTK_WIDGET (td->dialog));
>  #if HAVE_KTOBLZCHECK_H
>    AccountNumberCheck_delete(td->blzcheck);
> @@ -125,6 +135,11 @@
>    g_assert(td);
>    return td->gnc_trans;
>  }
> +gboolean gnc_hbci_dialog_get_templ_changed(const HBCITransDialog *td)
> +{
> +  g_assert(td);
> +  return td->templ_changed;
> +}
>  void gnc_hbci_dialog_hide(HBCITransDialog *td)
>  {
>    g_assert(td);
> @@ -147,8 +162,17 @@
>  check_ktoblzcheck(GtkWidget *parent, const HBCITransDialog *td, 
>  		  const HBCI_Transaction *trans);
>  
> +void on_template_list_select_child(GtkList  *list, GtkWidget  *widget, gpointer  user_data);
> +void on_template_list_selection_changed(GtkList *list, gpointer  user_data);
> +void on_template_list_unselect_child(GtkList  *list, GtkWidget  *widget, gpointer  user_data);
> +
>  void template_selection_cb(GtkButton *b, gpointer user_data);
>  void add_template_cb(GtkButton *b, gpointer user_data);
> +void moveup_template_cb(GtkButton *button, gpointer user_data);
> +void movedown_template_cb(GtkButton *button, gpointer user_data);
> +void sort_template_cb(GtkButton *button, gpointer user_data);
> +void del_template_cb(GtkButton *button, gpointer user_data);
> +
>  void blz_changed_cb(GtkEditable *e, gpointer user_data);
>  
>  
> @@ -163,20 +187,20 @@
>   * constructor 
>   */
>  
> -static void fill_template_menu_func(gpointer data, gpointer user_data)
> +static void fill_template_list_func(gpointer data, gpointer user_data)
>  {
>    GNCTransTempl *templ = data;
> -  GtkMenu *menu = user_data;
> +  GtkList *list = user_data;
>    GtkWidget *item;
>  
>    g_assert(templ);
> -  g_assert(menu);
> +  g_assert(list);
>    
> -  item = gtk_menu_item_new_with_label(gnc_trans_templ_get_name(templ));
> +  item = gtk_list_item_new_with_label(gnc_trans_templ_get_name(templ));
>    g_assert(item);
>    
>    gtk_object_set_user_data(GTK_OBJECT(item), templ);
> -  gtk_menu_append(menu, item);
> +  gtk_container_add(GTK_CONTAINER(list), item );
>  }
>  
>  HBCITransDialog *
> @@ -227,6 +251,10 @@
>      GtkWidget *orig_bankcode_heading;
>      GtkWidget *exec_later_button;
>      GtkWidget *add_templ_button;
> +    GtkWidget *moveup_templ_button;
> +    GtkWidget *movedown_templ_button;
> +    GtkWidget *sort_templ_button;
> +    GtkWidget *del_templ_button;
>          
>      g_assert 
>        (heading_label = glade_xml_get_widget (xml, "heading_label"));
> @@ -269,9 +297,17 @@
>      g_assert
>        (exec_later_button = glade_xml_get_widget (xml, "exec_later_button"));
>      g_assert
> -      (td->template_option = glade_xml_get_widget (xml, "template_optionmenu"));
> +      (td->template_gtk_list = glade_xml_get_widget (xml, "template_list"));
>      g_assert
>        (add_templ_button = glade_xml_get_widget (xml, "add_templ_button"));
> +    g_assert
> +      (moveup_templ_button = glade_xml_get_widget (xml, "moveup_templ_button"));
> +    g_assert
> +      (movedown_templ_button = glade_xml_get_widget (xml, "movedown_templ_button"));
> +    g_assert
> +      (sort_templ_button = glade_xml_get_widget (xml, "sort_templ_button"));
> +    g_assert
> +      (del_templ_button = glade_xml_get_widget (xml, "del_templ_button"));
>  
>      td->amount_edit = gnc_amount_edit_new();
>      gtk_box_pack_start_defaults(GTK_BOX(amount_hbox), td->amount_edit);
> @@ -331,17 +367,41 @@
>      gtk_label_set_text (GTK_LABEL (orig_bankcode_label), 
>  			HBCI_Bank_bankCode (bank));
>  
> -    /* fill OptionMenu for choosing a transaction template */
> -    g_list_foreach(td->templ, fill_template_menu_func, 
> -		   gtk_option_menu_get_menu 
> -		   ( GTK_OPTION_MENU (td->template_option)));
> +    /* fill list for choosing a transaction template */
> +    g_list_foreach(td->templ, fill_template_list_func, 
> +		    GTK_LIST (td->template_gtk_list));
> +
> +    td->selected_template = NULL;
> +    td->templ_changed = FALSE;
>      
>      /* Connect signals */
> -    gnc_option_menu_init_w_signal (td->template_option, 
> +/*    gnc_option_menu_init_w_signal (td->template_option, 
>  				   GTK_SIGNAL_FUNC(template_selection_cb),
> -				   td);
> +				   td);   */
> +    gtk_signal_connect (GTK_OBJECT (td->template_gtk_list), "select_child",
> +                      GTK_SIGNAL_FUNC (on_template_list_select_child),
> +                      td);
> +                      
>      gtk_signal_connect(GTK_OBJECT (add_templ_button), "clicked",
>  		       GTK_SIGNAL_FUNC(add_template_cb), td);
> +
> +    gtk_signal_connect (GTK_OBJECT (moveup_templ_button), "clicked",
> +                      GTK_SIGNAL_FUNC (moveup_template_cb),
> +                      td);
> +                      
> +    gtk_signal_connect (GTK_OBJECT (movedown_templ_button), "clicked",
> +                      GTK_SIGNAL_FUNC (movedown_template_cb),
> +                      td);
> +
> +     gtk_signal_connect (GTK_OBJECT (sort_templ_button), "clicked",
> +                      GTK_SIGNAL_FUNC (sort_template_cb),
> +                      td);
> +
> +     gtk_signal_connect (GTK_OBJECT (del_templ_button), "clicked",
> +                      GTK_SIGNAL_FUNC (del_template_cb),
> +                      td);
> +
> +
>      gtk_signal_connect(GTK_OBJECT (td->recp_bankcode_entry), "changed",
>  		       GTK_SIGNAL_FUNC(blz_changed_cb), td);
>  
> @@ -619,31 +679,53 @@
>    gtk_entry_set_text (GTK_ENTRY (entry), str ? str : ""); 
>  }
>  
> -void template_selection_cb(GtkButton *b,
> -			   gpointer user_data)
> +
> +void
> +on_template_list_select_child          (GtkList         *list,
> +                                        GtkWidget       *widget,
> +                                        gpointer         user_data)
>  {
>    HBCITransDialog *td = user_data;
> -  unsigned index;
>    g_assert(td);
> -  index = gnc_option_menu_get_active (td->template_option);
> -  /*printf("template_selection_cd: %d is active \n", index);*/
> -  if ((index > 0) && (index <= g_list_length(td->templ)))
> -    {
> -      GNCTransTempl *templ = g_list_nth_data(td->templ, index-1);
> -      /*printf("template_selection_cd: using template %s \n", 
> -	gnc_trans_templ_get_name(templ));*/
> +
> +  td->selected_template = widget;
> +  
> +  GNCTransTempl *templ = gtk_object_get_user_data (GTK_OBJECT(widget)) ;
>  
>        fill_entry(gnc_trans_templ_get_recp_name(templ), td->recp_name_entry);
>        fill_entry(gnc_trans_templ_get_recp_account(templ), td->recp_account_entry);
>        fill_entry(gnc_trans_templ_get_recp_bankcode(templ), td->recp_bankcode_entry);
>        fill_entry(gnc_trans_templ_get_purpose(templ), td->purpose_entry);
>        fill_entry(gnc_trans_templ_get_purpose_cont(templ), td->purpose_cont_entry);
> -      
> -      gnc_amount_edit_set_amount (GNC_AMOUNT_EDIT (td->amount_edit), 
> +
> +      gnc_amount_edit_set_amount (GNC_AMOUNT_EDIT (td->amount_edit),
>  				  gnc_trans_templ_get_amount (templ));
> -    }
> +
>  }
>  
> +
> +void
> +on_template_list_selection_changed     (GtkList         *list,
> +                                        gpointer         user_data)
> +{
> +
> +}
> +
> +
> +void
> +on_template_list_unselect_child        (GtkList         *list,
> +                                        GtkWidget       *widget,
> +                                        gpointer         user_data)
> +{
> +  HBCITransDialog *td = user_data;
> +  g_assert(td);
> +
> +  td->selected_template = NULL;
> +
> +}
> +
> +
> +
>  void blz_changed_cb(GtkEditable *e, gpointer user_data)
>  {
>  #if HAVE_KTOBLZCHECK_H
> @@ -694,6 +776,8 @@
>    GtkWidget *dlg;
>    char *name;
>    int retval = -1;
> +  GNCTransTempl *t;
> +  gint index;
>    g_assert(td);
>  
>    dlg = gnome_request_dialog(FALSE,
> @@ -713,22 +797,169 @@
>         gtk_entry_get_text (GTK_ENTRY (td->purpose_entry)),
>         gtk_entry_get_text (GTK_ENTRY (td->purpose_cont_entry)));
>  
> -    /* Append new template to the list. */
> -    td->templ = g_list_append(td->templ, r);
> +  if (td->selected_template) {
> +    t = gtk_object_get_user_data(GTK_OBJECT(td->selected_template));
> +
> +    index = 1+gtk_list_child_position(GTK_LIST(td->template_gtk_list), td->selected_template);
> +    }
> +  else index = 0;
> +  
> +  td->templ = g_list_insert(td->templ, r, index);
>      
> -    /* Also append that template to the OptionMenu */
> -    fill_template_menu_func(r, 
> -			    gtk_option_menu_get_menu 
> -			    ( GTK_OPTION_MENU (td->template_option)));
> -    /* the show_all is necessary since otherwise the new item doesn't show up */
> -    gtk_widget_show_all (GTK_WIDGET (gtk_option_menu_get_menu 
> -				     ( GTK_OPTION_MENU (td->template_option))));
> -    gnc_option_menu_init_w_signal (td->template_option, 
> -				   GTK_SIGNAL_FUNC(template_selection_cb),
> -				   td);
> +  td->templ_changed = TRUE;
> +
> +  gtk_list_clear_items(GTK_LIST(td->template_gtk_list), 0, -1);
> +
> +  /* fill list for choosing a transaction template */
> +  g_list_foreach(td->templ, fill_template_list_func,
> +		    GTK_LIST (td->template_gtk_list));
> +
> +  gtk_list_select_item(GTK_LIST(td->template_gtk_list), index);
> +
> +  /* the show_all is necessary since otherwise the new item doesn't show up */
> +  gtk_widget_show_all (GTK_WIDGET ( GTK_LIST (td->template_gtk_list)));
> +  }
> +}
> +
> +
> +void
> +moveup_template_cb(GtkButton       *button,
> +                  gpointer         user_data)
> +{
> +  HBCITransDialog *td = user_data;
> +  GNCTransTempl *t;
> +  gint index;
> +  g_assert(td);
> +
> +  if (td->selected_template) {
> +    t = gtk_object_get_user_data(GTK_OBJECT(td->selected_template));
> +
> +    index = gtk_list_child_position(GTK_LIST(td->template_gtk_list), td->selected_template);
> +
> +    if (index > 0) {
> +      td->templ =  g_list_remove( td->templ, t);
> +      td->templ =  g_list_insert( td->templ, t, index-1);
> +
> +      td->templ_changed = TRUE;
> +      gtk_list_clear_items(GTK_LIST(td->template_gtk_list), 0, -1);
> +
> +      /* fill list for choosing a transaction template */
> +      g_list_foreach(td->templ, fill_template_list_func,
> +		    GTK_LIST (td->template_gtk_list));
> +
> +      gtk_list_select_item(GTK_LIST(td->template_gtk_list), index-1);
> +
> +      gtk_widget_show_all (GTK_WIDGET ( GTK_LIST (td->template_gtk_list)));
> +      }
> +    }
> +}
> +
> +
> +void
> +movedown_template_cb(GtkButton       *button,
> +                    gpointer         user_data)
> +{
> +  HBCITransDialog *td = user_data;
> +  GNCTransTempl *t;
> +  gint index;
> +  g_assert(td);
> +
> +  if (td->selected_template) {
> +    t = gtk_object_get_user_data(GTK_OBJECT(td->selected_template));
> +
> +    index = gtk_list_child_position(GTK_LIST(td->template_gtk_list), td->selected_template);
> +
> +    if (index < g_list_length(td->templ)-1) {
> +      td->templ =  g_list_remove( td->templ, t);
> +      td->templ =  g_list_insert( td->templ, t, index+1);
> +
> +      td->templ_changed = TRUE;
> +      gtk_list_clear_items(GTK_LIST(td->template_gtk_list), 0, -1);
> +
> +      /* fill list for choosing a transaction template */
> +      g_list_foreach(td->templ, fill_template_list_func,
> +		    GTK_LIST (td->template_gtk_list));
> +
> +      gtk_list_select_item(GTK_LIST(td->template_gtk_list), index+1);
> +
> +      gtk_widget_show_all (GTK_WIDGET ( GTK_LIST (td->template_gtk_list)));
> +      }
> +    }
> +}
> +
> +gint comparefunc(const gconstpointer e1,
> +                 const gconstpointer e2)
> +{
> +  return g_strcasecmp(gnc_trans_templ_get_name((GNCTransTempl*)e1),
> +        gnc_trans_templ_get_name((GNCTransTempl*)e2));
> +  
> +}  
> +                 
> +void
> +sort_template_cb(GtkButton       *button,
> +                 gpointer         user_data)
> +{
> +  HBCITransDialog *td = user_data;
> +  g_assert(td);
> +
> +  if (gnc_verify_dialog_parented (td->parent,
> +       FALSE, "%s", _("Really sort?"))) {
> +
> +    td->templ =  g_list_sort( td->templ, comparefunc);
> +  
> +    td->templ_changed = TRUE;
> +
> +    gtk_list_clear_items(GTK_LIST(td->template_gtk_list), 0, -1);
> +
> +    /* fill list for choosing a transaction template */
> +    g_list_foreach(td->templ, fill_template_list_func,
> +		    GTK_LIST (td->template_gtk_list));
> +
> +    gtk_list_unselect_all ( GTK_LIST (td->template_gtk_list) );
> +   
> +    gtk_widget_show_all (GTK_WIDGET ( GTK_LIST (td->template_gtk_list)));
>    }
>  }
>  
> +
> +
> +void
> +del_template_cb(GtkButton       *button,
> +               gpointer         user_data)
> +{
> +  HBCITransDialog *td = user_data;
> +  GNCTransTempl *t;
> +  gint index;
> +  g_assert(td);
> +
> +  if (td->selected_template) {
> +
> +    t = gtk_object_get_user_data(GTK_OBJECT(td->selected_template));
> +
> +    index = gtk_list_child_position(GTK_LIST(td->template_gtk_list), td->selected_template);
> +
> +    if (gnc_verify_dialog_parented (td->parent,
> +          FALSE, "%s: %s",
> +          gnc_trans_templ_get_name(g_list_nth_data(td->templ, index)),
> +          _("Really delete?")
> +          )) {
> +      gtk_list_clear_items(GTK_LIST(td->template_gtk_list), index, index+1);
> +            
> +      td->templ =  g_list_remove( td->templ, t);
> +      td->templ_changed = TRUE;
> +
> +      gnc_trans_templ_delete(t);
> +
> +      gtk_list_unselect_all ( GTK_LIST (td->template_gtk_list) );
> +
> +      gtk_widget_show_all (GTK_WIDGET ( GTK_LIST (td->template_gtk_list)));
> +    
> +      }
> +    }
> +}
> +
> +
> +
>  void gnc_hbci_dialog_xfer_cb(Transaction *trans, gpointer user_data)
>  {
>    HBCITransDialog *td = user_data;
> diff -Naur gnucash-1.8.8-original/src/import-export/hbci/dialog-hbcitrans.h gnucash-1.8.8-20040223/src/import-export/hbci/dialog-hbcitrans.h
> --- gnucash-1.8.8-original/src/import-export/hbci/dialog-hbcitrans.h	2003-07-02 22:56:01.000000000 +0200
> +++ gnucash-1.8.8-20040223/src/import-export/hbci/dialog-hbcitrans.h	2004-02-23 15:07:36.000000000 +0100
> @@ -1,6 +1,8 @@
>  /********************************************************************\
>   * dialog-hbcitrans.h -- dialog for HBCI transaction data           *
>   * Copyright (C) 2002 Christian Stimming                            *
> + * Copyright (C) 2004 Bernd Wagner (changes for                     *
> + *                     online transaction templates)                *
>   *                                                                  *
>   * This program is free software; you can redistribute it and/or    *
>   * modify it under the terms of the GNU General Public License as   *
> @@ -69,6 +71,8 @@
>  GtkWidget *gnc_hbci_dialog_get_parent(const HBCITransDialog *td);
>  /** Return the GList of transaction templates. */
>  GList *gnc_hbci_dialog_get_templ(const HBCITransDialog *td);
> +/** Return the change status of the template list */
> +gboolean gnc_hbci_dialog_get_templ_changed(const HBCITransDialog *td) ;
>  /** Return the HBCI_Transaction. */
>  const HBCI_Transaction *gnc_hbci_dialog_get_htrans(const HBCITransDialog *td);
>  /** Return the gnucash Transaction. */
> diff -Naur gnucash-1.8.8-original/src/import-export/hbci/glade/hbci.glade gnucash-1.8.8-20040223/src/import-export/hbci/glade/hbci.glade
> --- gnucash-1.8.8-original/src/import-export/hbci/glade/hbci.glade	2003-07-28 23:42:16.000000000 +0200
> +++ gnucash-1.8.8-20040223/src/import-export/hbci/glade/hbci.glade	2004-02-08 18:49:06.000000000 +0100
> @@ -2395,33 +2395,156 @@
>  	  </child>
>  
>  	  <widget>
> -	    <class>GtkButton</class>
> -	    <name>add_templ_button</name>
> -	    <border_width>2</border_width>
> -	    <can_focus>True</can_focus>
> -	    <label>Add current</label>
> -	    <relief>GTK_RELIEF_NORMAL</relief>
> +	    <class>GtkVBox</class>
> +	    <name>vbox158</name>
> +	    <homogeneous>False</homogeneous>
> +	    <spacing>0</spacing>
>  	    <child>
>  	      <padding>0</padding>
>  	      <expand>False</expand>
>  	      <fill>False</fill>
>  	      <pack>GTK_PACK_END</pack>
>  	    </child>
> +
> +	    <widget>
> +	      <class>GtkButton</class>
> +	      <name>add_templ_button</name>
> +	      <border_width>2</border_width>
> +	      <can_focus>True</can_focus>
> +	      <signal>
> +		<name>clicked</name>
> +		<handler>add_template_cb</handler>
> +		<last_modification_time>Sun, 19 Oct 2003 19:52:26 GMT</last_modification_time>
> +	      </signal>
> +	      <label>Add current</label>
> +	      <relief>GTK_RELIEF_NORMAL</relief>
> +	      <child>
> +		<padding>0</padding>
> +		<expand>False</expand>
> +		<fill>False</fill>
> +	      </child>
> +	    </widget>
> +
> +	    <widget>
> +	      <class>GtkButton</class>
> +	      <name>moveup_templ_button</name>
> +	      <border_width>2</border_width>
> +	      <can_focus>True</can_focus>
> +	      <signal>
> +		<name>clicked</name>
> +		<handler>moveup_templ_cb</handler>
> +		<last_modification_time>Sun, 08 Feb 2004 17:48:19 GMT</last_modification_time>
> +	      </signal>
> +	      <stock_button>GNOME_STOCK_BUTTON_UP</stock_button>
> +	      <relief>GTK_RELIEF_NORMAL</relief>
> +	      <child>
> +		<padding>0</padding>
> +		<expand>False</expand>
> +		<fill>False</fill>
> +	      </child>
> +	    </widget>
> +
> +	    <widget>
> +	      <class>GtkButton</class>
> +	      <name>movedown_templ_button</name>
> +	      <border_width>2</border_width>
> +	      <can_focus>True</can_focus>
> +	      <signal>
> +		<name>clicked</name>
> +		<handler>movedown_templ_cb</handler>
> +		<last_modification_time>Sun, 08 Feb 2004 17:48:35 GMT</last_modification_time>
> +	      </signal>
> +	      <stock_button>GNOME_STOCK_BUTTON_DOWN</stock_button>
> +	      <relief>GTK_RELIEF_NORMAL</relief>
> +	      <child>
> +		<padding>0</padding>
> +		<expand>False</expand>
> +		<fill>False</fill>
> +	      </child>
> +	    </widget>
> +
> +	    <widget>
> +	      <class>GtkButton</class>
> +	      <name>sort_templ_button</name>
> +	      <border_width>2</border_width>
> +	      <can_focus>True</can_focus>
> +	      <signal>
> +		<name>clicked</name>
> +		<handler>sort_templ_cb</handler>
> +		<last_modification_time>Sun, 08 Feb 2004 17:48:52 GMT</last_modification_time>
> +	      </signal>
> +	      <label>Sort</label>
> +	      <relief>GTK_RELIEF_NORMAL</relief>
> +	      <child>
> +		<padding>25</padding>
> +		<expand>False</expand>
> +		<fill>False</fill>
> +	      </child>
> +	    </widget>
> +
> +	    <widget>
> +	      <class>GtkButton</class>
> +	      <name>del_templ_button</name>
> +	      <border_width>2</border_width>
> +	      <can_focus>True</can_focus>
> +	      <signal>
> +		<name>clicked</name>
> +		<handler>del_template_cb</handler>
> +		<last_modification_time>Sun, 19 Oct 2003 19:55:28 GMT</last_modification_time>
> +	      </signal>
> +	      <label>Delete</label>
> +	      <relief>GTK_RELIEF_NORMAL</relief>
> +	      <child>
> +		<padding>0</padding>
> +		<expand>False</expand>
> +		<fill>False</fill>
> +	      </child>
> +	    </widget>
>  	  </widget>
>  
>  	  <widget>
> -	    <class>GtkOptionMenu</class>
> -	    <name>template_optionmenu</name>
> -	    <can_focus>True</can_focus>
> -	    <items>-- No Template --
> -</items>
> -	    <initial_choice>0</initial_choice>
> +	    <class>GtkScrolledWindow</class>
> +	    <name>template_scrolledwindow</name>
> +	    <width>350</width>
> +	    <height>142</height>
> +	    <hscrollbar_policy>GTK_POLICY_AUTOMATIC</hscrollbar_policy>
> +	    <vscrollbar_policy>GTK_POLICY_AUTOMATIC</vscrollbar_policy>
> +	    <hupdate_policy>GTK_UPDATE_CONTINUOUS</hupdate_policy>
> +	    <vupdate_policy>GTK_UPDATE_CONTINUOUS</vupdate_policy>
>  	    <child>
>  	      <padding>0</padding>
>  	      <expand>False</expand>
>  	      <fill>False</fill>
>  	      <pack>GTK_PACK_END</pack>
>  	    </child>
> +
> +	    <widget>
> +	      <class>GtkViewport</class>
> +	      <name>viewport1</name>
> +	      <shadow_type>GTK_SHADOW_IN</shadow_type>
> +
> +	      <widget>
> +		<class>GtkList</class>
> +		<name>template_list</name>
> +		<visible>False</visible>
> +		<signal>
> +		  <name>select_child</name>
> +		  <handler>on_template_list_select_child</handler>
> +		  <last_modification_time>Sun, 19 Oct 2003 20:56:25 GMT</last_modification_time>
> +		</signal>
> +		<signal>
> +		  <name>selection_changed</name>
> +		  <handler>on_template_list_selection_changed</handler>
> +		  <last_modification_time>Sun, 19 Oct 2003 20:57:16 GMT</last_modification_time>
> +		</signal>
> +		<signal>
> +		  <name>unselect_child</name>
> +		  <handler>on_template_list_unselect_child</handler>
> +		  <last_modification_time>Sun, 19 Oct 2003 20:57:22 GMT</last_modification_time>
> +		</signal>
> +		<selection_mode>GTK_SELECTION_SINGLE</selection_mode>
> +	      </widget>
> +	    </widget>
>  	  </widget>
>  
>  	  <widget>
> diff -Naur gnucash-1.8.8-original/src/import-export/hbci/gnc-hbci-transfer.c gnucash-1.8.8-20040223/src/import-export/hbci/gnc-hbci-transfer.c
> --- gnucash-1.8.8-original/src/import-export/hbci/gnc-hbci-transfer.c	2003-08-02 11:29:50.000000000 +0200
> +++ gnucash-1.8.8-20040223/src/import-export/hbci/gnc-hbci-transfer.c	2004-02-23 15:16:30.000000000 +0100
> @@ -1,6 +1,8 @@
>  /********************************************************************\
>   * gnc-hbci-transfer.c -- hbci transfer functions                   *
>   * Copyright (C) 2002 Christian Stimming                            *
> + * Copyright (C) 2004 Bernd Wagner (minor changes for                     *
> + *                     online transaction templates)                *
>   *                                                                  *
>   * This program is free software; you can redistribute it and/or    *
>   * modify it under the terms of the GNU General Public License as   *
> @@ -81,7 +83,6 @@
>        gnc_trans_templ_glist_from_kvp_glist
>        ( gnc_hbci_get_book_template_list
>  	( xaccAccountGetBook(gnc_acc)));
> -    unsigned nr_templates;
>      int result;
>      gboolean successful;
>      HBCITransDialog *td;
> @@ -96,16 +97,14 @@
>      /* Repeat until HBCI action was successful or user pressed cancel */
>      do {
>  
> -      nr_templates = g_list_length(template_list);
> -
>        /* Let the user enter the values. If cancel is pressed, -1 is returned.  */
>        result = gnc_hbci_dialog_run_until_ok(td, h_acc);
>  
>        /* Set the template list in case it got modified. */
>        template_list = gnc_hbci_dialog_get_templ(td);
> -      /* New templates? If yes, store them */
> -      if (nr_templates < g_list_length(template_list)) 
> -	maketrans_save_templates(parent, gnc_acc, template_list, (result >= 0));
> +      /* templates changed? If yes, store them */
> +      if (gnc_hbci_dialog_get_templ_changed(td) )
> +	       maketrans_save_templates(parent, gnc_acc, template_list, (result >= 0));
>  
>        if (result < 0) {
>  	break;
> @@ -179,9 +178,9 @@
>        (parent, 
>         FALSE,
>         "%s",
> -       _("You have created a new online transfer template, but \n"
> -	 "you cancelled the transfer dialog. Do you nevertheless \n"
> -	 "want to store the new online transfer template?"))) {
> +       _("You have changed the list of online transfer templates,\n"
> +	 "but you cancelled the transfer dialog.\n"
> +	 "Do you nevertheless want to store the changes?"))) {
>      GList *kvp_list = gnc_trans_templ_kvp_glist_from_glist (template_list);
>      /*printf ("Now having %d templates. List: '%s'\n", 
>        g_list_length(template_list),
> 
> 
> ------------------------------------------------------------------------
> 
> --- de.po.orig	2004-02-23 21:28:22.000000000 +0100
> +++ de.po	2004-02-23 21:34:50.963264064 +0100
> @@ -7377,9 +7377,8 @@
>  msgstr "Aktuelle hinzufügen"
>  
>  #: src/import-export/hbci/glade/hbci.glade:2476
> -#, fuzzy
>  msgid "Sort"
> -msgstr "Sortiere nach"
> +msgstr "Sortieren"
>  
>  #: src/import-export/hbci/glade/hbci.glade:2553
>  msgid "Use Transaction Template"
> @@ -8193,11 +8192,11 @@
>  
>  #: src/import-export/hbci/dialog-hbcitrans.c:906
>  msgid "Really sort?"
> -msgstr ""
> +msgstr "Wirklich sortieren?"
>  
>  #: src/import-export/hbci/dialog-hbcitrans.c:944
>  msgid "Really delete?"
> -msgstr ""
> +msgstr "Wirklich löschen?"
>  
>  #: src/import-export/hbci/gnc-hbci-getbalance.c:221
>  msgid ""
> @@ -8242,15 +8241,14 @@
>  msgstr "Es liegen keine Buchungen für die gewählte Zeitspanne vor."
>  
>  #: src/import-export/hbci/gnc-hbci-transfer.c:181
> -#, fuzzy
>  msgid ""
>  "You have changed the list of online transfer templates,\n"
>  "but you cancelled the transfer dialog.\n"
>  "Do you nevertheless want to store the changes?"
>  msgstr ""
> -"Sie haben eine neue Überweisungsvorlage hinzugefügt, aber Sie haben\n"
> -"den Überweisungsdialog abgebrochen. Möchten Sie die\n"
> -"Überweisungsvorlage trotzdem speichern?"
> +"Sie haben die Liste der Überweisungsvorlagen geändert,\n"
> +"aber Sie haben den Überweisungsdialog abgebrochen.\n"
> +"Möchten Sie die Liste trotzdem speichern?"
>  
>  #: src/import-export/hbci/gnc-hbci-transfer.c:212
>  msgid "Online HBCI Direct Debit Note"



More information about the gnucash-patches mailing list