Skip to content

Commit

Permalink
Bug 721913 - Fetch Rate crashes application
Browse files Browse the repository at this point in the history
Enable the "Fetch Rate" button only if Finance::Quote is installed.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@23730 57a11ea4-9604-0410-9ed3-97b8803252fd
  • Loading branch information
jralls committed Jan 20, 2014
1 parent f95294e commit 3e72e3c
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/gnome-utils/dialog-transfer.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
#include "engine-helpers.h"
#include "engine-helpers-guile.h"
#include "app-utils/QuickFill.h"
#include <gnc-commodity.h>


#define DIALOG_TRANSFER_CM_CLASS "dialog-transfer"
Expand Down Expand Up @@ -1238,6 +1239,19 @@ void gnc_xfer_dialog_set_amount_sensitive(XferDialog *xferData,
gtk_widget_set_sensitive(gnc_amount_edit_gtk_entry(GNC_AMOUNT_EDIT (xferData->amount_edit)), is_sensitive);
}

static void
gnc_xfer_dialog_set_fetch_sensitive (GtkWidget *fetch)
{
if (gnc_quote_source_fq_installed ())
{
gtk_widget_set_sensitive (fetch, TRUE);
gtk_widget_set_tooltip_text (fetch, _("Retrieve the current online quote"));
return;
}
gtk_widget_set_sensitive (fetch, FALSE);
gtk_widget_set_tooltip_text (fetch, _("Finance::Quote must be installed to enable this button."));
return;
}

/********************************************************************\
* gnc_xfer_dialog_set_description *
Expand Down Expand Up @@ -1786,6 +1800,7 @@ gnc_xfer_dialog_create(GtkWidget *parent, XferDialog *xferData)
xferData->transferinfo_label = GTK_WIDGET(gtk_builder_get_object (builder, "transferinfo-label"));

xferData->fetch_button = GTK_WIDGET(gtk_builder_get_object (builder, "fetch"));
gnc_xfer_dialog_set_fetch_sensitive (xferData->fetch_button);

/* amount & date widgets */
{
Expand Down

0 comments on commit 3e72e3c

Please sign in to comment.