[Gnucash-changes] Eventually enable all HBCI actions again.

Christian Stimming cstim at cvs.gnucash.org
Wed Jul 27 16:31:49 EDT 2005


Log Message:
-----------
Eventually enable all HBCI actions again.

2005-07-27  Christian Stimming  <stimming at tuhh.de>

	* src/import-export/hbci/dialog-hbcitrans.c: Eventually enable all
	HBCI actions again. Only the convenience transfer templates are
	not yet available, but all online actions work.

Tags:
----
gnucash-gnome2-dev

Modified Files:
--------------
    gnucash:
        ChangeLog
    gnucash/src/import-export/hbci:
        dialog-hbcitrans.c
        gnc-hbci-transfer.c
        hbci-interaction.c
    gnucash/src/import-export/hbci/glade:
        hbci.glade

Revision Data
-------------
Index: ChangeLog
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/ChangeLog,v
retrieving revision 1.1487.2.255
retrieving revision 1.1487.2.256
diff -LChangeLog -LChangeLog -u -r1.1487.2.255 -r1.1487.2.256
--- ChangeLog
+++ ChangeLog
@@ -1,3 +1,9 @@
+2005-07-27  Christian Stimming  <stimming at tuhh.de>
+
+	* src/import-export/hbci/dialog-hbcitrans.c: Eventually enable all
+	HBCI actions again. Only the convenience transfer templates are
+	not yet available, but all online actions work.
+
 2005-07-26  David Hampton  <hampton at employees.org>
 
 	* src/app-utils/prefs.scm:
Index: hbci-interaction.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/import-export/hbci/hbci-interaction.c,v
retrieving revision 1.16.4.13
retrieving revision 1.16.4.14
diff -Lsrc/import-export/hbci/hbci-interaction.c -Lsrc/import-export/hbci/hbci-interaction.c -u -r1.16.4.13 -r1.16.4.14
--- src/import-export/hbci/hbci-interaction.c
+++ src/import-export/hbci/hbci-interaction.c
@@ -697,11 +697,16 @@
 void GNCInteractor_add_log_text (GNCInteractor *data, const char *msg)
 {
   GtkTextBuffer *tb;
+  GtkTextView *tv;
   g_assert(data);
 
-  tb = gtk_text_view_get_buffer (GTK_TEXT_VIEW (data->log_text) );
+  tv = GTK_TEXT_VIEW (data->log_text);
+  tb = gtk_text_view_get_buffer (tv);
   gtk_text_buffer_insert_at_cursor (tb, msg, -1);
   gtk_text_buffer_insert_at_cursor (tb, "\n", -1);
+  /* and scroll to the end of the buffer */
+  gtk_text_view_scroll_to_mark (tv, gtk_text_buffer_get_insert (tb),
+				0.0, FALSE, 0.0, 0.0);
 }
 
 static void
Index: gnc-hbci-transfer.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/import-export/hbci/gnc-hbci-transfer.c,v
retrieving revision 1.7.4.7
retrieving revision 1.7.4.8
diff -Lsrc/import-export/hbci/gnc-hbci-transfer.c -Lsrc/import-export/hbci/gnc-hbci-transfer.c -u -r1.7.4.7 -r1.7.4.8
--- src/import-export/hbci/gnc-hbci-transfer.c
+++ src/import-export/hbci/gnc-hbci-transfer.c
@@ -144,7 +144,10 @@
 	  continue;
 	}
 
-	if (result == 0) {
+	/* Result of run_until_ok: 1 == execute now, 3 == scheduled
+	   for later execution (currently unimplemented); 2 ==
+	   cancel */
+	if (result == 1) {
 
 	  /* If the user pressed "execute now", then execute this job
 	     now. This function already delete()s the job. */
@@ -160,12 +163,12 @@
 	  }
 	  
 	  gnc_hbci_cleanup_job(api, job);
-	} /* result == 0 */
+	} /* result == 1 */
 	else {
 	  /* huh? Only result == 0 should be possible. Simply ignore
 	     this case. */
 	  break;
-	} /* result == 0 */
+	} /* result == 1 */
 	  
       } /* Create a do-transaction (transfer) job */
 	
Index: dialog-hbcitrans.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/import-export/hbci/dialog-hbcitrans.c,v
retrieving revision 1.9.4.13
retrieving revision 1.9.4.14
diff -Lsrc/import-export/hbci/dialog-hbcitrans.c -Lsrc/import-export/hbci/dialog-hbcitrans.c -u -r1.9.4.13 -r1.9.4.14
--- src/import-export/hbci/dialog-hbcitrans.c
+++ src/import-export/hbci/dialog-hbcitrans.c
@@ -112,8 +112,9 @@
     AB_Transaction_free (td->hbci_trans);
 
   td->selected_template = NULL;
-    
-  gtk_widget_destroy (GTK_WIDGET (td->dialog));
+
+  if (td->dialog)
+    gtk_widget_destroy (GTK_WIDGET (td->dialog));
 #if HAVE_KTOBLZCHECK_H
   AccountNumberCheck_delete(td->blzcheck);
 #endif    
@@ -235,7 +236,8 @@
   td->dialog = glade_xml_get_widget (xml, "HBCI_trans_dialog");
 
   if (parent)
-    gtk_widget_set_parent (td->dialog, parent);
+    gtk_window_set_transient_for (GTK_WINDOW (td->dialog), 
+				  GTK_WINDOW (parent));
   
   {
     GtkWidget *heading_label;
@@ -393,6 +395,8 @@
 /*    gnc_option_menu_init_w_signal (td->template_option, 
 				   GTK_SIGNAL_FUNC(template_selection_cb),
 				   td);   */
+    /* FIXME: commented out until the GTK_TREE_VIEW is implemented! */
+    /*
     gtk_signal_connect (GTK_OBJECT (td->template_gtktreeview), "select_child",
                       GTK_SIGNAL_FUNC (on_template_list_select_child),
                       td);
@@ -415,7 +419,7 @@
      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);
@@ -481,9 +485,9 @@
     /* The dialog gets hidden anyway as soon as any button is pressed. */
     gtk_widget_hide_all (td->dialog);
 
-    /* Was cancel pressed or dialog closed? 0 == execute now, 1 ==
-       scheduled for later execution (currently unimplemented) */
-    if (result != GTK_RESPONSE_OK) {
+    /* Was cancel pressed or dialog closed? 1 == execute now, 3 ==
+       scheduled for later execution (currently unimplemented); 2 == cancel */
+    if (result != 1 ) { /* <- currently hard-coded response-id from glade */
       gtk_widget_destroy (GTK_WIDGET (td->dialog));
       td->dialog = NULL;
       return -1;
@@ -510,6 +514,7 @@
 	   "Do you want to enter the job again?"));
       if (values_ok) {
 	AB_Transaction_free (td->hbci_trans);
+	td->hbci_trans = NULL;
 	return -1;
       }
       continue;
@@ -529,6 +534,7 @@
 	     "Do you want to enter the job again?"));
 	if (values_ok) {
 	  AB_Transaction_free (td->hbci_trans);
+	  td->hbci_trans = NULL;
 	  return -1;
 	}
 	continue;
@@ -558,9 +564,10 @@
   AB_TRANSACTION *trans = AB_Transaction_new();
   gchar *tmpchar;
 
-  /* FIXME: The internal source encoding is hard-coded so far. This
-     needs to be fixed for the gnome2 version; the source encoding is
-     then probably utf-8 as well. iconv is also used in
+  /* The internal source encoding is returned by
+     gnc_hbci_book_encoding(), which is hard-coded so far. This needs
+     to be fixed for the gnome2 version; the source encoding is then
+     probably utf-8 as well. iconv is also used in
      gnc_AB_BANKING_interactors() in hbci-interaction.c. */
   iconv_t gnc_iconv_handler =
     iconv_open(gnc_hbci_AQBANKING_encoding(), gnc_hbci_book_encoding());
@@ -830,8 +837,19 @@
   
   if (record) {
     const char *bankname = AccountNumberCheck_Record_bankName (record);
+    GError *error = NULL;
+    gchar *utf8_bankname = g_convert (bankname, strlen(bankname), 
+				      "UTF-8", "ISO-8859-15",
+				      NULL, NULL, &error);
+    if (error != NULL) {
+      printf ("Error convertion bankname \"%s\" to UTF-8\n", bankname);
+      g_error_free (error);
+      utf8_bankname = g_strdup (bankname);
+    }
     gtk_label_set_text (GTK_LABEL (td->recp_bankname_label),
-			(strlen(bankname)>0 ? bankname : _("(unknown)")));
+			(strlen(utf8_bankname)>0 ? 
+			 utf8_bankname : _("(unknown)")));
+    g_free (utf8_bankname);
     gtk_widget_show_all (td->recp_bankname_label);
 
     /*printf("blz_changed_cb: KtoBlzCheck said check is bank is '%s' at '%s'.\n",
Index: hbci.glade
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/import-export/hbci/glade/hbci.glade,v
retrieving revision 1.27.2.12
retrieving revision 1.27.2.13
diff -Lsrc/import-export/hbci/glade/hbci.glade -Lsrc/import-export/hbci/glade/hbci.glade -u -r1.27.2.12 -r1.27.2.13
--- src/import-export/hbci/glade/hbci.glade
+++ src/import-export/hbci/glade/hbci.glade
@@ -404,6 +404,7 @@
                 <property name="can_focus">yes</property>
                 <property name="label" translatable="yes">Execute Now</property>
                 <property name="visible">yes</property>
+	        <property name="response_id">1</property>
               </widget>
             </child>
 
@@ -413,6 +414,7 @@
                 <property name="can_focus">yes</property>
                 <property name="label" translatable="yes">Execute Later (unimpl.)</property>
                 <property name="visible">yes</property>
+	        <property name="response_id">3</property>
               </widget>
             </child>
 
@@ -424,6 +426,7 @@
                 <property name="label">gtk-cancel</property>
                 <property name="use_stock">yes</property>
                 <property name="use_underline">yes</property>
+	        <property name="response_id">2</property>
               </widget>
             </child>
           </widget>


More information about the gnucash-changes mailing list