mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Restore clickable links for price quotes.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13572 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
321f21a303
commit
64ee595be2
@ -1,3 +1,9 @@
|
||||
2006-03-09 David Hampton <hampton@employees.org>
|
||||
|
||||
* src/gnome/dialog-price-editor.c:
|
||||
* src/gnome/top-level.c:
|
||||
* src/gnc-ui.h: Restore clickable links for price quotes.
|
||||
|
||||
2006-03-09 Neil Williams <linux@codehelp.co.uk>
|
||||
|
||||
* src/optional/Makefile.am : Make xsl/ available
|
||||
|
@ -109,6 +109,7 @@ typedef enum
|
||||
|
||||
GNCPrice* gnc_price_edit_dialog (gncUIWidget parent, QofSession *session,
|
||||
GNCPrice *price, GNCPriceEditType type);
|
||||
GNCPrice* gnc_price_edit_by_guid (GtkWidget * parent, const GUID * guid);
|
||||
void gnc_prices_dialog (gncUIWidget parent);
|
||||
void gnc_commodities_dialog (gncUIWidget parent);
|
||||
|
||||
|
@ -37,6 +37,7 @@
|
||||
#include "gnc-date-edit.h"
|
||||
#include "qof.h"
|
||||
#include "gnc-pricedb.h"
|
||||
#include "gnc-session.h"
|
||||
#include "gnc-ui.h"
|
||||
#include "gnc-ui-util.h"
|
||||
#include "guile-util.h"
|
||||
@ -484,3 +485,24 @@ gnc_price_edit_dialog (GtkWidget * parent,
|
||||
gtk_widget_show (pedit_dialog->dialog);
|
||||
return(price);
|
||||
}
|
||||
|
||||
/********************************************************************\
|
||||
* gnc_price_edit_by_guid *
|
||||
* opens up a window to edit price information *
|
||||
* *
|
||||
* Args: parent - the parent of the window to be created *
|
||||
* Return: nothing *
|
||||
\********************************************************************/
|
||||
GNCPrice *
|
||||
gnc_price_edit_by_guid (GtkWidget * parent, const GUID * guid)
|
||||
{
|
||||
GNCPrice *price;
|
||||
QofSession *session;
|
||||
|
||||
session = gnc_get_current_session ();
|
||||
price = gnc_price_lookup (guid, qof_session_get_book(session));
|
||||
if (price == NULL)
|
||||
return(NULL);
|
||||
|
||||
return(gnc_price_edit_dialog(parent, session, price, GNC_PRICE_EDIT));
|
||||
}
|
||||
|
@ -167,6 +167,35 @@ gnc_html_register_url_cb (const char *location, const char *label,
|
||||
|
||||
/* ============================================================== */
|
||||
|
||||
static gboolean
|
||||
gnc_html_price_url_cb (const char *location, const char *label,
|
||||
gboolean new_window, GNCURLResult *result)
|
||||
{
|
||||
QofBook * book = gnc_get_current_book();
|
||||
g_return_val_if_fail (location != NULL, FALSE);
|
||||
g_return_val_if_fail (result != NULL, FALSE);
|
||||
|
||||
result->load_to_stream = FALSE;
|
||||
|
||||
/* href="gnc-register:guid=12345678901234567890123456789012" */
|
||||
IF_TYPE ("price-guid=", GNC_ID_PRICE)
|
||||
if (!gnc_price_edit_by_guid (NULL, &guid))
|
||||
{
|
||||
result->error_message = g_strdup_printf (_("No such price: %s"),
|
||||
location);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
result->error_message = g_strdup_printf (_("Badly formed URL %s"),
|
||||
location);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/** Restore all persistent program state. This function finds the
|
||||
* "new" state file associated with a specific book guid. It then
|
||||
* iterates through this state information, calling a helper function
|
||||
@ -360,6 +389,9 @@ gnc_main_gui_init (void)
|
||||
gnc_html_register_url_handler (URL_TYPE_REGISTER,
|
||||
gnc_html_register_url_cb);
|
||||
|
||||
gnc_html_register_url_handler (URL_TYPE_PRICE,
|
||||
gnc_html_price_url_cb);
|
||||
|
||||
gnc_ui_sx_initialize();
|
||||
|
||||
/* FIXME Remove this test code */
|
||||
|
Loading…
Reference in New Issue
Block a user