Convert a couple of dialogs from the deprecated gnome_ok_dialog to a

gtk_message_dialog.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@12006 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
David Hampton 2005-11-21 06:51:57 +00:00
parent 800f10dc81
commit 15fc424514
4 changed files with 54 additions and 32 deletions

View File

@ -1,5 +1,11 @@
2005-11-20 David Hampton <hampton@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

View File

@ -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 @@ gnc_hbci_getbalance_finish (GtkWidget *parent,
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_hbci_getbalance_finish (GtkWidget *parent,
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 @@ gnc_hbci_getbalance_finish (GtkWidget *parent,
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 {

View File

@ -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 @@ gnc_hbci_gettrans_final(GtkWidget *parent,
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 @@ gnc_hbci_gettrans_final(GtkWidget *parent,
if (run_until_done)
return gnc_gen_trans_list_run (importer_generic_gui);
}
else {
gnome_ok_dialog_parented
(_("The HBCI import returned no transactions for the selected time period."),
GTK_WINDOW (parent));
return TRUE;
}
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;
}

View File

@ -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 @@ showBoxCB(AB_BANKING *ab, GWEN_TYPE_UINT32 flags,
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;