[Gnucash-changes] r12006 - gnucash/trunk - Convert a couple of dialogs from the deprecated gnome_ok_dialog to a

David Hampton hampton at cvs.gnucash.org
Mon Nov 21 01:51:58 EST 2005


Author: hampton
Date: 2005-11-21 01:51:57 -0500 (Mon, 21 Nov 2005)
New Revision: 12006
Trac: http://svn.gnucash.org/trac/changeset/12006

Modified:
   gnucash/trunk/ChangeLog
   gnucash/trunk/src/import-export/hbci/gnc-hbci-getbalance.c
   gnucash/trunk/src/import-export/hbci/gnc-hbci-gettrans.c
   gnucash/trunk/src/import-export/hbci/hbci-interaction.c
Log:
Convert a couple of dialogs from the deprecated gnome_ok_dialog to a
gtk_message_dialog.


Modified: gnucash/trunk/ChangeLog
===================================================================
--- gnucash/trunk/ChangeLog	2005-11-21 06:36:15 UTC (rev 12005)
+++ gnucash/trunk/ChangeLog	2005-11-21 06:51:57 UTC (rev 12006)
@@ -1,5 +1,11 @@
 2005-11-20  David Hampton  <hampton at employees.org>
 
+	* src/import-export/hbci/gnc-hbci-gettrans.c:
+	* src/import-export/hbci/hbci-interaction.c:
+	* src/import-export/hbci/gnc-hbci-getbalance.c: Convert a couple
+	of dialogs from the deprecated gnome_ok_dialog to a
+	gtk_message_dialog.
+
 	* src/import-export/import-account-matcher.c:
 	* src/import-export/generic-import.glade: Put the account tree
 	into a scrolled window so the dialog buttons don't get pushed

Modified: gnucash/trunk/src/import-export/hbci/gnc-hbci-getbalance.c
===================================================================
--- gnucash/trunk/src/import-export/hbci/gnc-hbci-getbalance.c	2005-11-21 06:36:15 UTC (rev 12005)
+++ gnucash/trunk/src/import-export/hbci/gnc-hbci-getbalance.c	2005-11-21 06:51:57 UTC (rev 12006)
@@ -22,7 +22,7 @@
 
 #include "config.h"
 
-#include <gnome.h>
+#include <gtk/gtk.h>
 #include <glib/gi18n.h>
 #include <aqbanking/banking.h>
 
@@ -198,6 +198,7 @@
   gboolean dialogres;
   double booked_value, noted_value;
   gnc_numeric value;
+  GtkWidget *dialog;
 
   response = AB_JobGetBalance_GetAccountStatus((AB_JOB*)job);
   if (!response) {
@@ -248,18 +249,23 @@
 				 GNC_RND_ROUND);
   if ((noted_value == 0.0) && (booked_value == 0.0))
     {
-      gnome_ok_dialog_parented 
-	/* Translators: Strings from this file are really only
-	 * needed inside Germany (HBCI is not supported anywhere
-	 * else). You may safely ignore strings from the
-	 * import-export/hbci subdirectory in other countries.
-	 */
-	(_("The downloaded HBCI Balance was zero.\n"
+      dialog = gtk_message_dialog_new(GTK_WINDOW(parent),
+				      GTK_DIALOG_MODAL
+				      | GTK_DIALOG_DESTROY_WITH_PARENT,
+				      GTK_MESSAGE_INFO,
+				      GTK_BUTTONS_OK,
+	 /* Translators: Strings from this file are really only
+	  * needed inside Germany (HBCI is not supported anywhere
+	  * else). You may safely ignore strings from the
+	  * import-export/hbci subdirectory in other countries.
+	  */
+	 _("The downloaded HBCI Balance was zero.\n"
 	   "Either this is the correct balance, or your bank does not \n"
 	   "support Balance download in this HBCI version. In the latter \n"
 	   "case you should choose a higher HBCI version number in the HBCI \n"
-	   "Setup. After that, try again to download the HBCI Balance.\n"),
-	 GTK_WINDOW (parent));
+	   "Setup. After that, try again to download the HBCI Balance.\n"));
+      gtk_dialog_run(GTK_DIALOG(dialog));
+      gtk_widget_destroy(GTK_WIDGET(dialog));
       dialogres = FALSE;
     }
   else
@@ -283,9 +289,15 @@
       if (gnc_numeric_equal(value, reconc_balance)) {
 	const char *message3 = _("The booked balance is identical to the current \n"
 				 "reconciled balance of the account.");
-	char *msg = g_strdup_printf ("%s%s\n%s", message1, message2, message3);
-	gnome_ok_dialog_parented (msg, GTK_WINDOW (parent));
-	g_free (msg);
+	dialog = gtk_message_dialog_new(GTK_WINDOW(parent),
+					GTK_DIALOG_MODAL
+					| GTK_DIALOG_DESTROY_WITH_PARENT,
+					GTK_MESSAGE_INFO,
+					GTK_BUTTONS_OK,
+					"%s%s\n%s",
+					message1, message2, message3);
+	gtk_dialog_run(GTK_DIALOG(dialog));
+	gtk_widget_destroy(GTK_WIDGET(dialog));
 	dialogres = FALSE;
 
       } else {

Modified: gnucash/trunk/src/import-export/hbci/gnc-hbci-gettrans.c
===================================================================
--- gnucash/trunk/src/import-export/hbci/gnc-hbci-gettrans.c	2005-11-21 06:36:15 UTC (rev 12005)
+++ gnucash/trunk/src/import-export/hbci/gnc-hbci-gettrans.c	2005-11-21 06:51:57 UTC (rev 12006)
@@ -22,7 +22,7 @@
 
 #include "config.h"
 
-#include <gnome.h>
+#include <gtk/gtk.h>
 #include <glib/gi18n.h>
 
 #include "gnc-hbci-gettrans.h"
@@ -194,19 +194,12 @@
 			const AB_JOB *trans_job,
 			gboolean run_until_done)
 {
+  GtkWidget *dialog;
+
   /* Now add the retrieved transactions to the gnucash account. */
   AB_TRANSACTION_LIST2 *trans_list;
 
   trans_list = AB_JobGetTransactions_GetTransactions(trans_job);
-  if (!trans_list) {
-    /* printf("gnc_hbci_gettrans_final: No transactions section. Response was:\n"); */
-
-    gnome_ok_dialog_parented 
-      (_("The HBCI import returned no transactions for the selected time period."),
-       GTK_WINDOW (parent));
-    return TRUE;
-  }
-  
   if (trans_list && (AB_Transaction_List2_GetSize(trans_list) > 0)) {
     struct trans_list_data data;
     GNCImportMainMatcher *importer_generic_gui = 
@@ -219,14 +212,18 @@
 
     if (run_until_done)
       return gnc_gen_trans_list_run (importer_generic_gui);
-
+    return TRUE;
   }
-  else {
-    gnome_ok_dialog_parented 
-      (_("The HBCI import returned no transactions for the selected time period."),
-       GTK_WINDOW (parent));
-  }
 
+  dialog = gtk_message_dialog_new(GTK_WINDOW(parent),
+				  GTK_DIALOG_MODAL
+				  | GTK_DIALOG_DESTROY_WITH_PARENT,
+				  GTK_MESSAGE_INFO,
+				  GTK_BUTTONS_OK,
+				  _("The HBCI import returned no transactions "
+				    "for the selected time period."));
+  gtk_dialog_run(GTK_DIALOG(dialog));
+  gtk_widget_destroy(GTK_WIDGET(dialog));
   return TRUE;
 }
 

Modified: gnucash/trunk/src/import-export/hbci/hbci-interaction.c
===================================================================
--- gnucash/trunk/src/import-export/hbci/hbci-interaction.c	2005-11-21 06:36:15 UTC (rev 12005)
+++ gnucash/trunk/src/import-export/hbci/hbci-interaction.c	2005-11-21 06:51:57 UTC (rev 12006)
@@ -22,7 +22,7 @@
 
 #include "config.h"
 
-#include <gnome.h>
+#include <gtk/gtk.h>
 #include <glib/gi18n.h>
 #include <stdio.h>
 #include <string.h>
@@ -531,10 +531,17 @@
   title = gnc_hbci_utf8ToLatin1(data, utf8title);
 
   /* Create new dialog */
-  dialog = gnome_ok_dialog_parented (text, GTK_WINDOW (data->parent));
+  dialog = gtk_message_dialog_new(GTK_WINDOW(data->parent),
+				  0,
+				  GTK_MESSAGE_INFO,
+				  GTK_BUTTONS_OK,
+				  text);
+
   if (title && (strlen(title) > 0))
     gtk_window_set_title (GTK_WINDOW (dialog), title);
-  gnome_dialog_close_hides (GNOME_DIALOG(dialog), TRUE);
+
+  g_signal_connect(G_OBJECT(dialog), "response",
+		   (GCallback)gtk_widget_hide, NULL);
   gtk_widget_show_all (dialog);
 
   result = data->showbox_id;



More information about the gnucash-changes mailing list