mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Merge branch 'maint'
This commit is contained in:
commit
415f625bee
@ -279,7 +279,7 @@ string(REGEX MATCH "^[0-9]+[.]" SWIG_MAJOR ${SWIG_VERSION})
|
||||
|
||||
# guile library and include dir
|
||||
pkg_check_modules (GUILE3 guile-3.0 QUIET)
|
||||
pkg_check_modules (GUILE22 guile-2.2 QUIET)
|
||||
pkg_check_modules (GUILE22 guile-2.2)
|
||||
pkg_check_modules (GUILE2 guile-2.0>=2.0.9 QUIET)
|
||||
|
||||
if (GUILE3_FOUND) # found guile-3.0
|
||||
|
@ -743,6 +743,7 @@ tax_table_window_close_handler (gpointer data)
|
||||
TaxTableWindow *ttw = data;
|
||||
g_return_if_fail (ttw);
|
||||
|
||||
gnc_save_window_size (GNC_PREFS_GROUP, GTK_WINDOW(ttw->dialog));
|
||||
gtk_widget_destroy (ttw->dialog);
|
||||
}
|
||||
|
||||
@ -750,9 +751,19 @@ void
|
||||
tax_table_window_close (GtkWidget *widget, gpointer data)
|
||||
{
|
||||
TaxTableWindow *ttw = data;
|
||||
gnc_close_gui_component (ttw->component_id);
|
||||
}
|
||||
|
||||
gnc_save_window_size (GNC_PREFS_GROUP, GTK_WINDOW(ttw->dialog));
|
||||
gnc_ui_tax_table_window_destroy (ttw);
|
||||
static gboolean
|
||||
tax_table_window_delete_event_cb (GtkWidget *widget,
|
||||
GdkEvent *event,
|
||||
gpointer user_data)
|
||||
{
|
||||
TaxTableWindow *ttw = user_data;
|
||||
// this cb allows the window size to be saved on closing with the X
|
||||
gnc_save_window_size (GNC_PREFS_GROUP,
|
||||
GTK_WINDOW(ttw->dialog));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void
|
||||
@ -764,13 +775,33 @@ tax_table_window_destroy_cb (GtkWidget *widget, gpointer data)
|
||||
|
||||
gnc_unregister_gui_component (ttw->component_id);
|
||||
|
||||
if (ttw->dialog)
|
||||
{
|
||||
gtk_widget_destroy (ttw->dialog);
|
||||
ttw->dialog = NULL;
|
||||
}
|
||||
g_free (ttw);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
find_handler (gpointer find_data, gpointer user_data)
|
||||
tax_table_window_key_press_cb (GtkWidget *widget, GdkEventKey *event,
|
||||
gpointer data)
|
||||
{
|
||||
TaxTableWindow *ttw = user_data;
|
||||
TaxTableWindow *ttw = data;
|
||||
|
||||
if (event->keyval == GDK_KEY_Escape)
|
||||
{
|
||||
tax_table_window_close_handler (ttw);
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
find_handler (gpointer find_data, gpointer data)
|
||||
{
|
||||
TaxTableWindow *ttw = data;
|
||||
QofBook *book = find_data;
|
||||
|
||||
return (ttw != NULL && ttw->book == book);
|
||||
@ -819,6 +850,12 @@ gnc_ui_tax_table_window_new (GtkWindow *parent, QofBook *book)
|
||||
gtk_widget_set_name (GTK_WIDGET(ttw->dialog), "gnc-id-new-tax-table");
|
||||
gnc_widget_style_context_add_class (GTK_WIDGET(ttw->dialog), "gnc-class-taxes");
|
||||
|
||||
g_signal_connect (ttw->dialog, "delete-event",
|
||||
G_CALLBACK(tax_table_window_delete_event_cb), ttw);
|
||||
|
||||
g_signal_connect (ttw->dialog, "key_press_event",
|
||||
G_CALLBACK (tax_table_window_key_press_cb), ttw);
|
||||
|
||||
/* Create the tax tables view */
|
||||
view = GTK_TREE_VIEW(ttw->names_view);
|
||||
store = gtk_list_store_new (NUM_TAX_TABLE_COLS, G_TYPE_STRING,
|
||||
@ -890,16 +927,6 @@ gnc_ui_tax_table_window_new (GtkWindow *parent, QofBook *book)
|
||||
return ttw;
|
||||
}
|
||||
|
||||
/* Destroy a tax-table window */
|
||||
void
|
||||
gnc_ui_tax_table_window_destroy (TaxTableWindow *ttw)
|
||||
{
|
||||
if (!ttw)
|
||||
return;
|
||||
|
||||
gnc_close_gui_component (ttw->component_id);
|
||||
}
|
||||
|
||||
/* Create a new tax-table by name */
|
||||
GncTaxTable *
|
||||
gnc_ui_tax_table_new_from_name (GtkWindow *parent, QofBook *book, const char *name)
|
||||
|
@ -718,8 +718,7 @@ void
|
||||
billterms_window_close (GtkWidget *widget, gpointer data)
|
||||
{
|
||||
BillTermsWindow *btw = data;
|
||||
|
||||
gnc_ui_billterms_window_destroy (btw);
|
||||
gnc_close_gui_component (btw->component_id);
|
||||
}
|
||||
|
||||
void
|
||||
@ -731,13 +730,33 @@ billterms_window_destroy_cb (GtkWidget *widget, gpointer data)
|
||||
|
||||
gnc_unregister_gui_component (btw->component_id);
|
||||
|
||||
if (btw->window)
|
||||
{
|
||||
gtk_widget_destroy (btw->window);
|
||||
btw->window = NULL;
|
||||
}
|
||||
g_free (btw);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
find_handler (gpointer find_data, gpointer user_data)
|
||||
billterms_window_key_press_cb (GtkWidget *widget, GdkEventKey *event,
|
||||
gpointer data)
|
||||
{
|
||||
BillTermsWindow *btw = user_data;
|
||||
BillTermsWindow *btw = data;
|
||||
|
||||
if (event->keyval == GDK_KEY_Escape)
|
||||
{
|
||||
billterms_window_close_handler (btw);
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
find_handler (gpointer find_data, gpointer data)
|
||||
{
|
||||
BillTermsWindow *btw = data;
|
||||
QofBook *book = find_data;
|
||||
|
||||
return (btw != NULL && btw->book == book);
|
||||
@ -789,6 +808,9 @@ gnc_ui_billterms_window_new (GtkWindow *parent, QofBook *book)
|
||||
gtk_widget_set_name (GTK_WIDGET(btw->window), "gnc-id-bill-terms");
|
||||
gnc_widget_style_context_add_class (GTK_WIDGET(btw->window), "gnc-class-bill-terms");
|
||||
|
||||
g_signal_connect (btw->window, "key_press_event",
|
||||
G_CALLBACK (billterms_window_key_press_cb), btw);
|
||||
|
||||
/* Initialize the view */
|
||||
view = GTK_TREE_VIEW(btw->terms_view);
|
||||
store = gtk_list_store_new (NUM_BILL_TERM_COLS, G_TYPE_STRING, G_TYPE_POINTER);
|
||||
@ -836,16 +858,6 @@ gnc_ui_billterms_window_new (GtkWindow *parent, QofBook *book)
|
||||
return btw;
|
||||
}
|
||||
|
||||
/* Destroy a billterms window */
|
||||
void
|
||||
gnc_ui_billterms_window_destroy (BillTermsWindow *btw)
|
||||
{
|
||||
if (!btw)
|
||||
return;
|
||||
|
||||
gnc_close_gui_component (btw->component_id);
|
||||
}
|
||||
|
||||
#if 0
|
||||
/* Create a new billterms by name */
|
||||
GncBillTerm *
|
||||
|
@ -70,6 +70,9 @@ void gnc_commodities_dialog_edit_clicked (GtkWidget *widget, gpointer data);
|
||||
void gnc_commodities_dialog_remove_clicked (GtkWidget *widget, gpointer data);
|
||||
void gnc_commodities_dialog_close_clicked (GtkWidget *widget, gpointer data);
|
||||
void gnc_commodities_show_currencies_toggled (GtkToggleButton *toggle, CommoditiesDialog *cd);
|
||||
gboolean gnc_commodities_window_key_press_cb (GtkWidget *widget,
|
||||
GdkEventKey *event,
|
||||
gpointer data);
|
||||
|
||||
|
||||
void
|
||||
@ -79,12 +82,24 @@ gnc_commodities_window_destroy_cb (GtkWidget *object, CommoditiesDialog *cd)
|
||||
|
||||
if (cd->window)
|
||||
{
|
||||
gtk_widget_destroy(cd->window);
|
||||
gtk_widget_destroy (cd->window);
|
||||
cd->window = NULL;
|
||||
}
|
||||
g_free (cd);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gnc_commodities_window_delete_event_cb (GtkWidget *widget,
|
||||
GdkEvent *event,
|
||||
gpointer data)
|
||||
{
|
||||
CommoditiesDialog *cd = data;
|
||||
// this cb allows the window size to be saved on closing with the X
|
||||
gnc_save_window_size (GNC_PREFS_GROUP,
|
||||
GTK_WINDOW(cd->window));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void
|
||||
gnc_commodities_dialog_edit_clicked (GtkWidget *widget, gpointer data)
|
||||
{
|
||||
@ -247,6 +262,7 @@ void
|
||||
gnc_commodities_dialog_close_clicked (GtkWidget *widget, gpointer data)
|
||||
{
|
||||
CommoditiesDialog *cd = data;
|
||||
|
||||
gnc_close_gui_component_by_data (DIALOG_COMMODITIES_CM_CLASS, cd);
|
||||
}
|
||||
|
||||
@ -361,6 +377,12 @@ gnc_commodities_dialog_create (GtkWidget * parent, CommoditiesDialog *cd)
|
||||
g_signal_connect (cd->window, "destroy",
|
||||
G_CALLBACK(gnc_commodities_window_destroy_cb), cd);
|
||||
|
||||
g_signal_connect (cd->window, "delete-event",
|
||||
G_CALLBACK(gnc_commodities_window_delete_event_cb), cd);
|
||||
|
||||
g_signal_connect (cd->window, "key_press_event",
|
||||
G_CALLBACK (gnc_commodities_window_key_press_cb), cd);
|
||||
|
||||
gtk_builder_connect_signals_full (builder, gnc_builder_connect_full_func, cd);
|
||||
g_object_unref (G_OBJECT(builder));
|
||||
|
||||
@ -401,6 +423,21 @@ show_handler (const char *klass, gint component_id,
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
gboolean
|
||||
gnc_commodities_window_key_press_cb (GtkWidget *widget, GdkEventKey *event,
|
||||
gpointer data)
|
||||
{
|
||||
CommoditiesDialog *cd = data;
|
||||
|
||||
if (event->keyval == GDK_KEY_Escape)
|
||||
{
|
||||
close_handler (cd);
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/********************************************************************\
|
||||
* gnc_commodities_dialog *
|
||||
* opens up a window to edit price information *
|
||||
|
@ -229,6 +229,19 @@ setup_file_dialog (GtkBuilder *builder, GtkFileChooserButton *fcb,
|
||||
g_free (display_uri);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gnc_doclink_get_uri_event_cb (GtkWidget *widget, GdkEventKey *event,
|
||||
gpointer user_data)
|
||||
{
|
||||
if (event->keyval == GDK_KEY_Escape)
|
||||
{
|
||||
gtk_dialog_response (GTK_DIALOG(widget),
|
||||
GTK_RESPONSE_CANCEL);
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
gchar *
|
||||
gnc_doclink_get_uri_dialog (GtkWindow *parent, const gchar *title,
|
||||
const gchar *uri)
|
||||
@ -258,6 +271,10 @@ gnc_doclink_get_uri_dialog (GtkWindow *parent, const gchar *title,
|
||||
gtk_widget_set_name (GTK_WIDGET(dialog), "gnc-id-doclink");
|
||||
gnc_widget_style_context_add_class (GTK_WIDGET(dialog), "gnc-class-doclink");
|
||||
|
||||
// Use this event to capture the escape key being pressed
|
||||
g_signal_connect (dialog, "key_press_event",
|
||||
G_CALLBACK(gnc_doclink_get_uri_event_cb), dialog);
|
||||
|
||||
head_label = GTK_WIDGET(gtk_builder_get_object (builder, "path_head_label"));
|
||||
ok_button = GTK_WIDGET(gtk_builder_get_object (builder, "ok_button"));
|
||||
|
||||
@ -361,6 +378,22 @@ gnc_doclink_get_uri_dialog (GtkWindow *parent, const gchar *title,
|
||||
|
||||
static void close_handler (gpointer user_data);
|
||||
|
||||
static gboolean
|
||||
gnc_doclink_dialog_window_delete_event_cb (GtkWidget *widget,
|
||||
GdkEvent *event,
|
||||
gpointer user_data)
|
||||
{
|
||||
DoclinkDialog *doclink_dialog = user_data;
|
||||
// this cb allows the window size to be saved on closing with the X
|
||||
if (doclink_dialog->is_list_trans)
|
||||
gnc_save_window_size (GNC_PREFS_GROUP_TRANS,
|
||||
GTK_WINDOW(doclink_dialog->window));
|
||||
else
|
||||
gnc_save_window_size (GNC_PREFS_GROUP_BUS,
|
||||
GTK_WINDOW(doclink_dialog->window));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
gnc_doclink_dialog_window_destroy_cb (GtkWidget *object, gpointer user_data)
|
||||
{
|
||||
@ -959,6 +992,9 @@ gnc_doclink_dialog_create (GtkWindow *parent, DoclinkDialog *doclink_dialog)
|
||||
G_CALLBACK (gnc_doclink_dialog_window_destroy_cb),
|
||||
doclink_dialog);
|
||||
|
||||
g_signal_connect (doclink_dialog->window, "delete-event",
|
||||
G_CALLBACK(gnc_doclink_dialog_window_delete_event_cb), doclink_dialog);
|
||||
|
||||
g_signal_connect (doclink_dialog->window, "key_press_event",
|
||||
G_CALLBACK (gnc_doclink_dialog_window_key_press_cb),
|
||||
doclink_dialog);
|
||||
@ -979,8 +1015,6 @@ gnc_doclink_dialog_create (GtkWindow *parent, DoclinkDialog *doclink_dialog)
|
||||
g_signal_connect (doclink_dialog->view, "row-activated",
|
||||
G_CALLBACK (row_selected_trans_cb),
|
||||
(gpointer)doclink_dialog);
|
||||
gnc_restore_window_size (GNC_PREFS_GROUP_TRANS,
|
||||
GTK_WINDOW (doclink_dialog->window), parent);
|
||||
get_trans_info (doclink_dialog);
|
||||
}
|
||||
else
|
||||
@ -1002,8 +1036,6 @@ gnc_doclink_dialog_create (GtkWindow *parent, DoclinkDialog *doclink_dialog)
|
||||
g_signal_connect (doclink_dialog->view, "row-activated",
|
||||
G_CALLBACK (row_selected_bus_cb),
|
||||
(gpointer)doclink_dialog);
|
||||
gnc_restore_window_size (GNC_PREFS_GROUP_BUS,
|
||||
GTK_WINDOW (doclink_dialog->window), parent);
|
||||
get_bus_info (doclink_dialog);
|
||||
}
|
||||
|
||||
@ -1012,8 +1044,6 @@ gnc_doclink_dialog_create (GtkWindow *parent, DoclinkDialog *doclink_dialog)
|
||||
|
||||
g_object_unref (G_OBJECT(builder));
|
||||
|
||||
gtk_widget_show_all (GTK_WIDGET(window));
|
||||
|
||||
gtk_tree_view_column_set_expand (expanding_column, TRUE);
|
||||
gtk_tree_view_columns_autosize (GTK_TREE_VIEW(doclink_dialog->view));
|
||||
LEAVE(" ");
|
||||
@ -1091,6 +1121,9 @@ gnc_doclink_business_dialog (GtkWindow *parent)
|
||||
gnc_gui_component_set_session (doclink_dialog->component_id,
|
||||
doclink_dialog->session);
|
||||
|
||||
gnc_restore_window_size (GNC_PREFS_GROUP_BUS,
|
||||
GTK_WINDOW(doclink_dialog->window), parent);
|
||||
gtk_widget_show_all (GTK_WIDGET(doclink_dialog->window));
|
||||
LEAVE(" ");
|
||||
}
|
||||
|
||||
@ -1119,5 +1152,8 @@ gnc_doclink_trans_dialog (GtkWindow *parent)
|
||||
gnc_gui_component_set_session (doclink_dialog->component_id,
|
||||
doclink_dialog->session);
|
||||
|
||||
gnc_restore_window_size (GNC_PREFS_GROUP_TRANS,
|
||||
GTK_WINDOW(doclink_dialog->window), parent);
|
||||
gtk_widget_show_all (GTK_WIDGET(doclink_dialog->window));
|
||||
LEAVE(" ");
|
||||
}
|
||||
|
@ -59,13 +59,16 @@
|
||||
static QofLogModule log_module = GNC_MOD_GUI;
|
||||
|
||||
|
||||
void gnc_prices_dialog_window_destroy_cb (GtkWidget *object, gpointer data);
|
||||
void gnc_prices_dialog_destroy_cb (GtkWidget *object, gpointer data);
|
||||
void gnc_prices_dialog_close_cb (GtkDialog *dialog, gpointer data);
|
||||
void gnc_prices_dialog_edit_clicked (GtkWidget *widget, gpointer data);
|
||||
void gnc_prices_dialog_remove_clicked (GtkWidget *widget, gpointer data);
|
||||
void gnc_prices_dialog_remove_old_clicked (GtkWidget *widget, gpointer data);
|
||||
void gnc_prices_dialog_add_clicked (GtkWidget *widget, gpointer data);
|
||||
void gnc_prices_dialog_get_quotes_clicked (GtkWidget *widget, gpointer data);
|
||||
static gboolean gnc_prices_dialog_key_press_cb (GtkWidget *widget,
|
||||
GdkEventKey *event,
|
||||
gpointer data);
|
||||
|
||||
|
||||
typedef struct
|
||||
@ -88,7 +91,7 @@ typedef struct
|
||||
|
||||
|
||||
void
|
||||
gnc_prices_dialog_window_destroy_cb (GtkWidget *object, gpointer data)
|
||||
gnc_prices_dialog_destroy_cb (GtkWidget *object, gpointer data)
|
||||
{
|
||||
PricesDialog *pdb_dialog = data;
|
||||
|
||||
@ -97,7 +100,7 @@ gnc_prices_dialog_window_destroy_cb (GtkWidget *object, gpointer data)
|
||||
|
||||
if (pdb_dialog->window)
|
||||
{
|
||||
gtk_widget_destroy(pdb_dialog->window);
|
||||
gtk_widget_destroy (pdb_dialog->window);
|
||||
pdb_dialog->window = NULL;
|
||||
}
|
||||
|
||||
@ -106,6 +109,19 @@ gnc_prices_dialog_window_destroy_cb (GtkWidget *object, gpointer data)
|
||||
}
|
||||
|
||||
|
||||
static gboolean
|
||||
gnc_prices_dialog_delete_event_cb (GtkWidget *widget,
|
||||
GdkEvent *event,
|
||||
gpointer data)
|
||||
{
|
||||
PricesDialog *pdb_dialog = data;
|
||||
// this cb allows the window size to be saved on closing with the X
|
||||
gnc_save_window_size (GNC_PREFS_GROUP,
|
||||
GTK_WINDOW(pdb_dialog->window));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
gnc_prices_dialog_close_cb (GtkDialog *dialog, gpointer data)
|
||||
{
|
||||
@ -713,6 +729,12 @@ gnc_prices_dialog_create (GtkWidget * parent, PricesDialog *pdb_dialog)
|
||||
pdb_dialog->book = qof_session_get_book(pdb_dialog->session);
|
||||
pdb_dialog->price_db = gnc_pricedb_get_db(pdb_dialog->book);
|
||||
|
||||
g_signal_connect (pdb_dialog->window, "delete-event",
|
||||
G_CALLBACK(gnc_prices_dialog_delete_event_cb), pdb_dialog);
|
||||
|
||||
g_signal_connect (pdb_dialog->window, "key_press_event",
|
||||
G_CALLBACK (gnc_prices_dialog_key_press_cb), pdb_dialog);
|
||||
|
||||
/* price tree */
|
||||
scrolled_window = GTK_WIDGET(gtk_builder_get_object (builder, "price_list_window"));
|
||||
view = gnc_tree_view_price_new(pdb_dialog->book,
|
||||
@ -761,7 +783,7 @@ gnc_prices_dialog_create (GtkWidget * parent, PricesDialog *pdb_dialog)
|
||||
}
|
||||
|
||||
g_signal_connect (pdb_dialog->window, "destroy",
|
||||
G_CALLBACK(gnc_prices_dialog_window_destroy_cb), pdb_dialog);
|
||||
G_CALLBACK(gnc_prices_dialog_destroy_cb), pdb_dialog);
|
||||
|
||||
gtk_builder_connect_signals_full (builder, gnc_builder_connect_full_func, pdb_dialog);
|
||||
g_object_unref(G_OBJECT(builder));
|
||||
@ -811,6 +833,22 @@ show_handler (const char *klass, gint component_id,
|
||||
}
|
||||
|
||||
|
||||
gboolean
|
||||
gnc_prices_dialog_key_press_cb (GtkWidget *widget, GdkEventKey *event,
|
||||
gpointer data)
|
||||
{
|
||||
PricesDialog *pdb_dialog = data;
|
||||
|
||||
if (event->keyval == GDK_KEY_Escape)
|
||||
{
|
||||
close_handler (pdb_dialog);
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
/********************************************************************\
|
||||
* gnc_prices_dialog *
|
||||
* opens up a window showing all price information *
|
||||
|
@ -1,6 +1,6 @@
|
||||
/********************************************************************
|
||||
* dialog-report-style-sheet.c -- window for configuring HTML style *
|
||||
* sheets in GnuCash *
|
||||
* sheets in GnuCash *
|
||||
* Copyright (C) 2000 Bill Gribble <grib@billgribble.com> *
|
||||
* Copyright (c) 2006 David Hampton <hampton@employees.org> *
|
||||
* *
|
||||
@ -30,27 +30,34 @@
|
||||
#include "dialog-report-style-sheet.h"
|
||||
#include "dialog-options.h"
|
||||
#include "dialog-utils.h"
|
||||
#include "gnc-component-manager.h"
|
||||
#include "gnc-session.h"
|
||||
#include "gnc-gtk-utils.h"
|
||||
#include "gnc-guile-utils.h"
|
||||
#include "gnc-report.h"
|
||||
#include "gnc-ui.h"
|
||||
|
||||
#define DIALOG_STYLE_SHEETS_CM_CLASS "style-sheets-dialog"
|
||||
#define GNC_PREFS_GROUP "dialogs.style-sheet"
|
||||
|
||||
StyleSheetDialog * gnc_style_sheet_dialog = NULL;
|
||||
|
||||
struct _stylesheetdialog
|
||||
{
|
||||
GtkWidget * toplevel;
|
||||
GtkWidget * toplevel;
|
||||
GtkTreeView * list_view;
|
||||
GtkListStore * list_store;
|
||||
GtkWidget * options_frame;
|
||||
GtkWidget * options_frame;
|
||||
gint component_id;
|
||||
QofSession * session;
|
||||
};
|
||||
|
||||
typedef struct ss_info
|
||||
{
|
||||
GNCOptionWin * odialog;
|
||||
GNCOptionDB * odb;
|
||||
SCM stylesheet;
|
||||
GtkTreeRowReference *row_ref;
|
||||
GNCOptionWin * odialog;
|
||||
GNCOptionDB * odb;
|
||||
SCM stylesheet;
|
||||
GtkTreeRowReference * row_ref;
|
||||
} ss_info;
|
||||
|
||||
enum
|
||||
@ -61,68 +68,71 @@ enum
|
||||
N_COLUMNS
|
||||
};
|
||||
|
||||
void gnc_style_sheet_select_dialog_new_cb (GtkWidget *widget, gpointer user_data);
|
||||
void gnc_style_sheet_select_dialog_edit_cb (GtkWidget *widget, gpointer user_data);
|
||||
void gnc_style_sheet_select_dialog_delete_cb (GtkWidget *widget, gpointer user_data);
|
||||
void gnc_style_sheet_select_dialog_close_cb (GtkWidget *widget, gpointer user_data);
|
||||
void gnc_style_sheet_select_dialog_destroy_cb (GtkWidget *widget, gpointer user_data);
|
||||
|
||||
/************************************************************
|
||||
* Style Sheet Edit Dialog (I.E. an options dialog) *
|
||||
************************************************************/
|
||||
|
||||
static void
|
||||
dirty_same_stylesheet(gpointer key, gpointer val, gpointer data)
|
||||
dirty_same_stylesheet (gpointer key, gpointer val, gpointer data)
|
||||
{
|
||||
SCM dirty_ss = data;
|
||||
SCM rep_ss = NULL;
|
||||
SCM report = val;
|
||||
SCM func = NULL;
|
||||
|
||||
func = scm_c_eval_string("gnc:report-stylesheet");
|
||||
if (scm_is_procedure(func))
|
||||
rep_ss = scm_call_1(func, report);
|
||||
func = scm_c_eval_string ("gnc:report-stylesheet");
|
||||
if (scm_is_procedure (func))
|
||||
rep_ss = scm_call_1 (func, report);
|
||||
else
|
||||
return;
|
||||
|
||||
if (scm_is_true(scm_eq_p(rep_ss, dirty_ss)))
|
||||
if (scm_is_true (scm_eq_p (rep_ss, dirty_ss)))
|
||||
{
|
||||
func = scm_c_eval_string("gnc:report-set-dirty?!");
|
||||
func = scm_c_eval_string ("gnc:report-set-dirty?!");
|
||||
/* This makes _me_ feel dirty! */
|
||||
if (scm_is_procedure(func))
|
||||
scm_call_2(func, report, SCM_BOOL_T);
|
||||
if (scm_is_procedure (func))
|
||||
scm_call_2 (func, report, SCM_BOOL_T);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gnc_style_sheet_options_apply_cb(GNCOptionWin * propertybox,
|
||||
gpointer user_data)
|
||||
gnc_style_sheet_options_apply_cb (GNCOptionWin * propertybox,
|
||||
gpointer user_data)
|
||||
{
|
||||
ss_info * ssi = (ss_info *)user_data;
|
||||
GHashTable *reports = NULL;
|
||||
GList *results = NULL, *iter;
|
||||
|
||||
/* FIXME: shouldn't be global */
|
||||
reports = gnc_reports_get_global();
|
||||
reports = gnc_reports_get_global ();
|
||||
if (reports)
|
||||
g_hash_table_foreach(reports, dirty_same_stylesheet, ssi->stylesheet);
|
||||
g_hash_table_foreach (reports, dirty_same_stylesheet, ssi->stylesheet);
|
||||
|
||||
results = gnc_option_db_commit (ssi->odb);
|
||||
for (iter = results; iter; iter = iter->next)
|
||||
{
|
||||
GtkWidget *dialog = gtk_message_dialog_new(NULL,
|
||||
0,
|
||||
GTK_MESSAGE_ERROR,
|
||||
GTK_BUTTONS_OK,
|
||||
"%s",
|
||||
(char*)iter->data);
|
||||
gtk_dialog_run(GTK_DIALOG(dialog));
|
||||
gtk_widget_destroy(dialog);
|
||||
GtkWidget *dialog = gtk_message_dialog_new (NULL,
|
||||
0,
|
||||
GTK_MESSAGE_ERROR,
|
||||
GTK_BUTTONS_OK,
|
||||
"%s",
|
||||
(char*)iter->data);
|
||||
gtk_dialog_run (GTK_DIALOG(dialog));
|
||||
gtk_widget_destroy (dialog);
|
||||
g_free (iter->data);
|
||||
}
|
||||
g_list_free (results);
|
||||
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
gnc_style_sheet_options_close_cb(GNCOptionWin * propertybox,
|
||||
gpointer user_data)
|
||||
gnc_style_sheet_options_close_cb (GNCOptionWin * propertybox,
|
||||
gpointer user_data)
|
||||
{
|
||||
ss_info * ssi = user_data;
|
||||
GtkTreeIter iter;
|
||||
@ -135,77 +145,74 @@ gnc_style_sheet_options_close_cb(GNCOptionWin * propertybox,
|
||||
gtk_list_store_set (ss->list_store, &iter,
|
||||
COLUMN_DIALOG, NULL,
|
||||
-1);
|
||||
gtk_tree_path_free(path);
|
||||
gtk_tree_path_free (path);
|
||||
}
|
||||
gtk_tree_row_reference_free (ssi->row_ref);
|
||||
gnc_options_dialog_destroy(ssi->odialog);
|
||||
gnc_option_db_destroy(ssi->odb);
|
||||
scm_gc_unprotect_object(ssi->stylesheet);
|
||||
g_free(ssi);
|
||||
gnc_options_dialog_destroy (ssi->odialog);
|
||||
gnc_option_db_destroy (ssi->odb);
|
||||
scm_gc_unprotect_object (ssi->stylesheet);
|
||||
g_free (ssi);
|
||||
}
|
||||
|
||||
|
||||
static ss_info *
|
||||
gnc_style_sheet_dialog_create(StyleSheetDialog * ss,
|
||||
gchar *name,
|
||||
SCM sheet_info,
|
||||
GtkTreeRowReference *row_ref)
|
||||
gnc_style_sheet_dialog_create (StyleSheetDialog * ss,
|
||||
gchar *name,
|
||||
SCM sheet_info,
|
||||
GtkTreeRowReference *row_ref)
|
||||
{
|
||||
SCM get_options = scm_c_eval_string("gnc:html-style-sheet-options");
|
||||
SCM get_options = scm_c_eval_string ("gnc:html-style-sheet-options");
|
||||
|
||||
SCM scm_options = scm_call_1(get_options, sheet_info);
|
||||
ss_info * ssinfo = g_new0(ss_info, 1);
|
||||
SCM scm_options = scm_call_1 (get_options, sheet_info);
|
||||
ss_info * ssinfo = g_new0 (ss_info, 1);
|
||||
GtkWidget * window;
|
||||
gchar * title;
|
||||
GtkWindow * parent = GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (ss->list_view)));
|
||||
GtkWindow * parent = GTK_WINDOW(gtk_widget_get_toplevel (GTK_WIDGET(ss->list_view)));
|
||||
|
||||
title = g_strdup_printf(_("HTML Style Sheet Properties: %s"), name);
|
||||
ssinfo->odialog = gnc_options_dialog_new(title, parent);
|
||||
ssinfo->odb = gnc_option_db_new(scm_options);
|
||||
title = g_strdup_printf (_("HTML Style Sheet Properties: %s"), name);
|
||||
ssinfo->odialog = gnc_options_dialog_new (title, parent);
|
||||
ssinfo->odb = gnc_option_db_new (scm_options);
|
||||
ssinfo->stylesheet = sheet_info;
|
||||
ssinfo->row_ref = row_ref;
|
||||
g_free(title);
|
||||
g_free (title);
|
||||
|
||||
scm_gc_protect_object(ssinfo->stylesheet);
|
||||
g_object_ref(gnc_options_dialog_widget(ssinfo->odialog));
|
||||
scm_gc_protect_object (ssinfo->stylesheet);
|
||||
g_object_ref (gnc_options_dialog_widget (ssinfo->odialog));
|
||||
|
||||
gnc_options_dialog_build_contents(ssinfo->odialog,
|
||||
ssinfo->odb);
|
||||
gnc_options_dialog_set_apply_cb(ssinfo->odialog,
|
||||
gnc_style_sheet_options_apply_cb,
|
||||
ssinfo);
|
||||
gnc_options_dialog_set_close_cb(ssinfo->odialog,
|
||||
gnc_style_sheet_options_close_cb,
|
||||
ssinfo);
|
||||
window = gnc_options_dialog_widget(ssinfo->odialog);
|
||||
gtk_window_set_transient_for(GTK_WINDOW(window),
|
||||
GTK_WINDOW(gnc_style_sheet_dialog->toplevel));
|
||||
gtk_window_set_destroy_with_parent(GTK_WINDOW(window), TRUE);
|
||||
gtk_window_present(GTK_WINDOW(window));
|
||||
|
||||
return(ssinfo);
|
||||
gnc_options_dialog_build_contents (ssinfo->odialog,
|
||||
ssinfo->odb);
|
||||
gnc_options_dialog_set_apply_cb (ssinfo->odialog,
|
||||
gnc_style_sheet_options_apply_cb,
|
||||
ssinfo);
|
||||
gnc_options_dialog_set_close_cb (ssinfo->odialog,
|
||||
gnc_style_sheet_options_close_cb,
|
||||
ssinfo);
|
||||
window = gnc_options_dialog_widget (ssinfo->odialog);
|
||||
gtk_window_set_transient_for (GTK_WINDOW(window),
|
||||
GTK_WINDOW(gnc_style_sheet_dialog->toplevel));
|
||||
gtk_window_set_destroy_with_parent (GTK_WINDOW(window), TRUE);
|
||||
gtk_window_present (GTK_WINDOW(window));
|
||||
return (ssinfo);
|
||||
}
|
||||
|
||||
|
||||
static SCM
|
||||
gnc_style_sheet_new (StyleSheetDialog * ssd)
|
||||
{
|
||||
SCM make_ss = scm_c_eval_string("gnc:make-html-style-sheet");
|
||||
SCM templates = scm_c_eval_string("(gnc:get-html-templates)");
|
||||
SCM t_name = scm_c_eval_string("gnc:html-style-sheet-template-name");
|
||||
SCM new_ss = SCM_BOOL_F;
|
||||
GtkWidget * template_combo;
|
||||
GtkTreeModel * template_model;
|
||||
GtkTreeIter iter;
|
||||
GtkWidget * name_entry;
|
||||
gint dialog_retval;
|
||||
GList *template_names = NULL;
|
||||
SCM make_ss = scm_c_eval_string ("gnc:make-html-style-sheet");
|
||||
SCM templates = scm_c_eval_string ("(gnc:get-html-templates)");
|
||||
SCM t_name = scm_c_eval_string ("gnc:html-style-sheet-template-name");
|
||||
SCM new_ss = SCM_BOOL_F;
|
||||
GtkWidget * template_combo;
|
||||
GtkTreeModel * template_model;
|
||||
GtkTreeIter iter;
|
||||
GtkWidget * name_entry;
|
||||
gint dialog_retval;
|
||||
GList * template_names = NULL;
|
||||
|
||||
/* get the new name for the style sheet */
|
||||
GtkBuilder *builder;
|
||||
GtkWidget *dlg;
|
||||
GtkBuilder * builder;
|
||||
GtkWidget * dlg;
|
||||
|
||||
builder = gtk_builder_new();
|
||||
builder = gtk_builder_new ();
|
||||
gnc_builder_add_from_file (builder, "dialog-report.glade", "template_liststore");
|
||||
gnc_builder_add_from_file (builder, "dialog-report.glade", "new_style_sheet_dialog");
|
||||
|
||||
@ -217,75 +224,73 @@ gnc_style_sheet_new (StyleSheetDialog * ssd)
|
||||
gtk_widget_set_name (GTK_WIDGET(dlg), "gnc-id-style-sheet-new");
|
||||
gnc_widget_style_context_add_class (GTK_WIDGET(dlg), "gnc-class-style-sheets");
|
||||
|
||||
g_assert(ssd);
|
||||
g_assert (ssd);
|
||||
|
||||
/* Erase the initial dummy entry. */
|
||||
template_model = gtk_combo_box_get_model(GTK_COMBO_BOX(template_combo));
|
||||
gtk_list_store_clear(GTK_LIST_STORE(template_model));
|
||||
template_model = gtk_combo_box_get_model (GTK_COMBO_BOX(template_combo));
|
||||
gtk_list_store_clear (GTK_LIST_STORE(template_model));
|
||||
|
||||
/* put in the list of style sheet type names */
|
||||
for (; !scm_is_null(templates); templates = SCM_CDR(templates))
|
||||
for (; !scm_is_null (templates); templates = SCM_CDR(templates))
|
||||
{
|
||||
gchar* orig_name;
|
||||
|
||||
SCM t = SCM_CAR(templates);
|
||||
orig_name = gnc_scm_call_1_to_string(t_name, t);
|
||||
orig_name = gnc_scm_call_1_to_string (t_name, t);
|
||||
|
||||
/* Store the untranslated names for lookup later */
|
||||
template_names = g_list_prepend (template_names, (gpointer)orig_name);
|
||||
|
||||
/* The displayed name should be translated */
|
||||
gtk_list_store_append(GTK_LIST_STORE(template_model), &iter);
|
||||
gtk_list_store_append (GTK_LIST_STORE(template_model), &iter);
|
||||
gtk_list_store_set (GTK_LIST_STORE(template_model), &iter, 0, _(orig_name), -1);
|
||||
|
||||
/* Note: don't g_free orig_name here - template_names still refers to it*/
|
||||
}
|
||||
gtk_combo_box_set_active(GTK_COMBO_BOX(template_combo), 0);
|
||||
gtk_combo_box_set_active (GTK_COMBO_BOX(template_combo), 0);
|
||||
|
||||
/* get the name */
|
||||
gtk_window_set_transient_for (GTK_WINDOW(dlg), GTK_WINDOW(ssd->toplevel));
|
||||
dialog_retval = gtk_dialog_run(GTK_DIALOG(dlg));
|
||||
dialog_retval = gtk_dialog_run (GTK_DIALOG(dlg));
|
||||
|
||||
if (dialog_retval == GTK_RESPONSE_OK)
|
||||
{
|
||||
gint choice = gtk_combo_box_get_active (GTK_COMBO_BOX(template_combo));
|
||||
const char *template_str = g_list_nth_data (template_names, choice);
|
||||
const char *name_str = gtk_entry_get_text(GTK_ENTRY(name_entry));
|
||||
if (name_str && strlen(name_str) == 0)
|
||||
const char *name_str = gtk_entry_get_text (GTK_ENTRY(name_entry));
|
||||
if (name_str && strlen (name_str) == 0)
|
||||
{
|
||||
/* If the name is empty, we display an error dialog but
|
||||
* refuse to create the new style sheet. */
|
||||
gnc_error_dialog (GTK_WINDOW (ssd->toplevel), "%s", _("You must provide a name for the new style sheet."));
|
||||
gnc_error_dialog (GTK_WINDOW(ssd->toplevel), "%s", _("You must provide a name for the new style sheet."));
|
||||
name_str = NULL;
|
||||
}
|
||||
if (template_str && name_str)
|
||||
{
|
||||
new_ss = scm_call_2(make_ss,
|
||||
scm_from_utf8_string(template_str),
|
||||
scm_from_utf8_string(name_str));
|
||||
new_ss = scm_call_2 (make_ss,
|
||||
scm_from_utf8_string (template_str),
|
||||
scm_from_utf8_string (name_str));
|
||||
}
|
||||
}
|
||||
|
||||
g_list_free_full (template_names, g_free);
|
||||
|
||||
g_object_unref(G_OBJECT(builder));
|
||||
g_object_unref (G_OBJECT(builder));
|
||||
|
||||
gtk_widget_destroy(dlg);
|
||||
return(new_ss);
|
||||
gtk_widget_destroy (dlg);
|
||||
return (new_ss);
|
||||
}
|
||||
|
||||
|
||||
/************************************************************
|
||||
* Style Sheet Selection Dialog *
|
||||
************************************************************/
|
||||
static void
|
||||
gnc_style_sheet_select_dialog_add_one(StyleSheetDialog * ss,
|
||||
SCM sheet_info,
|
||||
gboolean select)
|
||||
gnc_style_sheet_select_dialog_add_one (StyleSheetDialog * ss,
|
||||
SCM sheet_info,
|
||||
gboolean select)
|
||||
{
|
||||
SCM get_name;
|
||||
gchar *c_name;
|
||||
GtkTreeSelection *selection;
|
||||
GtkTreeIter iter;
|
||||
|
||||
get_name = scm_c_eval_string ("gnc:html-style-sheet-name");
|
||||
@ -307,130 +312,195 @@ gnc_style_sheet_select_dialog_add_one(StyleSheetDialog * ss,
|
||||
|
||||
if (select)
|
||||
{
|
||||
selection = gtk_tree_view_get_selection (ss->list_view);
|
||||
GtkTreeSelection * selection = gtk_tree_view_get_selection (ss->list_view);
|
||||
gtk_tree_selection_select_iter (selection, &iter);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gnc_style_sheet_select_dialog_fill(StyleSheetDialog * ss)
|
||||
gnc_style_sheet_select_dialog_fill (StyleSheetDialog * ss)
|
||||
{
|
||||
SCM stylesheets = scm_c_eval_string("(gnc:get-html-style-sheets)");
|
||||
SCM stylesheets = scm_c_eval_string ("(gnc:get-html-style-sheets)");
|
||||
SCM sheet_info;
|
||||
|
||||
/* pack it full of content */
|
||||
for (; !scm_is_null(stylesheets); stylesheets = SCM_CDR(stylesheets))
|
||||
for (; !scm_is_null (stylesheets); stylesheets = SCM_CDR(stylesheets))
|
||||
{
|
||||
sheet_info = SCM_CAR(stylesheets);
|
||||
gnc_style_sheet_select_dialog_add_one(ss, sheet_info, FALSE);
|
||||
gnc_style_sheet_select_dialog_add_one (ss, sheet_info, FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gnc_style_sheet_select_dialog_response_cb (GtkDialog *unused,
|
||||
gint response,
|
||||
gpointer user_data)
|
||||
{
|
||||
StyleSheetDialog * ss;
|
||||
GtkTreeSelection * selection;
|
||||
GtkTreeRowReference * row_ref;
|
||||
GtkTreeModel * model;
|
||||
GtkTreePath * path;
|
||||
GtkTreeIter iter;
|
||||
ss_info * ssinfo;
|
||||
SCM remover;
|
||||
SCM sheet_info;
|
||||
gchar *name;
|
||||
|
||||
ss = (StyleSheetDialog *)user_data;
|
||||
switch (response)
|
||||
{
|
||||
case GNC_RESPONSE_NEW:
|
||||
sheet_info = gnc_style_sheet_new(ss);
|
||||
if (sheet_info == SCM_BOOL_F)
|
||||
break;
|
||||
gnc_style_sheet_select_dialog_add_one(ss, sheet_info, TRUE);
|
||||
/* Fall through */
|
||||
|
||||
case GNC_RESPONSE_EDIT:
|
||||
selection = gtk_tree_view_get_selection (ss->list_view);
|
||||
if (gtk_tree_selection_get_selected (selection, &model, &iter))
|
||||
{
|
||||
gtk_tree_model_get (model, &iter,
|
||||
COLUMN_NAME, &name,
|
||||
COLUMN_STYLESHEET, &sheet_info,
|
||||
-1);
|
||||
/* Fire off options dialog here */
|
||||
path = gtk_tree_model_get_path (GTK_TREE_MODEL(ss->list_store), &iter);
|
||||
row_ref = gtk_tree_row_reference_new (GTK_TREE_MODEL(ss->list_store), path);
|
||||
ssinfo = gnc_style_sheet_dialog_create(ss, name, sheet_info, row_ref);
|
||||
gtk_list_store_set (ss->list_store, &iter,
|
||||
COLUMN_DIALOG, ssinfo,
|
||||
-1);
|
||||
g_free(name);
|
||||
}
|
||||
break;
|
||||
|
||||
case GNC_RESPONSE_DELETE:
|
||||
selection = gtk_tree_view_get_selection (ss->list_view);
|
||||
if (gtk_tree_selection_get_selected (selection, &model, &iter))
|
||||
{
|
||||
gtk_tree_model_get (model, &iter,
|
||||
COLUMN_STYLESHEET, &sheet_info,
|
||||
COLUMN_DIALOG, &ssinfo,
|
||||
-1);
|
||||
gtk_list_store_remove (ss->list_store, &iter);
|
||||
|
||||
if (ssinfo)
|
||||
gnc_style_sheet_options_close_cb(NULL, ssinfo);
|
||||
remover = scm_c_eval_string("gnc:html-style-sheet-remove");
|
||||
scm_call_1(remover, sheet_info);
|
||||
scm_gc_unprotect_object(sheet_info);
|
||||
}
|
||||
break;
|
||||
|
||||
case GTK_RESPONSE_CLOSE:
|
||||
default:
|
||||
gtk_widget_destroy(ss->toplevel);
|
||||
gnc_style_sheet_dialog = NULL;
|
||||
g_free(ss);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
gnc_style_sheet_select_dialog_event_cb (GtkWidget *widget,
|
||||
GdkEvent *event,
|
||||
gpointer user_data)
|
||||
{
|
||||
StyleSheetDialog * ss = user_data;
|
||||
StyleSheetDialog * ss = (StyleSheetDialog *)user_data;
|
||||
|
||||
g_return_if_fail(event != NULL);
|
||||
g_return_if_fail(ss != NULL);
|
||||
g_return_if_fail (event != NULL);
|
||||
g_return_if_fail (ss != NULL);
|
||||
|
||||
if (event->type != GDK_2BUTTON_PRESS)
|
||||
return;
|
||||
|
||||
/* Synthesize a click of the edit button */
|
||||
gnc_style_sheet_select_dialog_response_cb (NULL, GNC_RESPONSE_EDIT, ss);
|
||||
gnc_style_sheet_select_dialog_edit_cb (NULL, ss);
|
||||
}
|
||||
|
||||
void
|
||||
gnc_style_sheet_select_dialog_new_cb (GtkWidget *widget, gpointer user_data)
|
||||
{
|
||||
StyleSheetDialog * ss = (StyleSheetDialog *)user_data;
|
||||
SCM sheet_info;
|
||||
|
||||
sheet_info = gnc_style_sheet_new (ss);
|
||||
if (sheet_info == SCM_BOOL_F)
|
||||
return;
|
||||
|
||||
gnc_style_sheet_select_dialog_add_one (ss, sheet_info, TRUE);
|
||||
|
||||
// now start the edit dialog
|
||||
gnc_style_sheet_select_dialog_edit_cb (NULL, ss);
|
||||
}
|
||||
|
||||
void
|
||||
gnc_style_sheet_select_dialog_edit_cb (GtkWidget *widget, gpointer user_data)
|
||||
{
|
||||
StyleSheetDialog * ss = (StyleSheetDialog *)user_data;
|
||||
GtkTreeSelection * selection = gtk_tree_view_get_selection (ss->list_view);
|
||||
GtkTreeModel * model;
|
||||
GtkTreeIter iter;
|
||||
|
||||
if (gtk_tree_selection_get_selected (selection, &model, &iter))
|
||||
{
|
||||
GtkTreeRowReference * row_ref;
|
||||
GtkTreePath * path;
|
||||
ss_info * ssinfo;
|
||||
gchar * name;
|
||||
|
||||
SCM sheet_info = NULL;
|
||||
|
||||
gtk_tree_model_get (model, &iter,
|
||||
COLUMN_NAME, &name,
|
||||
COLUMN_STYLESHEET, &sheet_info,
|
||||
-1);
|
||||
/* Fire off options dialog here */
|
||||
path = gtk_tree_model_get_path (GTK_TREE_MODEL(ss->list_store), &iter);
|
||||
row_ref = gtk_tree_row_reference_new (GTK_TREE_MODEL(ss->list_store), path);
|
||||
ssinfo = gnc_style_sheet_dialog_create (ss, name, sheet_info, row_ref);
|
||||
gtk_list_store_set (ss->list_store, &iter,
|
||||
COLUMN_DIALOG, ssinfo,
|
||||
-1);
|
||||
gtk_tree_path_free (path);
|
||||
g_free (name);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
gnc_style_sheet_select_dialog_delete_cb (GtkWidget *widget, gpointer user_data)
|
||||
{
|
||||
StyleSheetDialog * ss = (StyleSheetDialog *)user_data;
|
||||
GtkTreeSelection * selection = gtk_tree_view_get_selection (ss->list_view);
|
||||
GtkTreeModel * model;
|
||||
GtkTreeIter iter;
|
||||
|
||||
if (gtk_tree_selection_get_selected (selection, &model, &iter))
|
||||
{
|
||||
ss_info * ssinfo;
|
||||
|
||||
SCM sheet_info = NULL;
|
||||
SCM remover;
|
||||
|
||||
gtk_tree_model_get (model, &iter,
|
||||
COLUMN_STYLESHEET, &sheet_info,
|
||||
COLUMN_DIALOG, &ssinfo,
|
||||
-1);
|
||||
gtk_list_store_remove (ss->list_store, &iter);
|
||||
|
||||
if (ssinfo)
|
||||
gnc_style_sheet_options_close_cb (NULL, ssinfo);
|
||||
remover = scm_c_eval_string ("gnc:html-style-sheet-remove");
|
||||
scm_call_1 (remover, sheet_info);
|
||||
scm_gc_unprotect_object (sheet_info);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
gnc_style_sheet_select_dialog_close_cb (GtkWidget *widget, gpointer user_data)
|
||||
{
|
||||
StyleSheetDialog * ss = (StyleSheetDialog *)user_data;
|
||||
gnc_close_gui_component (ss->component_id);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gnc_style_sheet_select_dialog_delete_event_cb (GtkWidget *widget,
|
||||
GdkEvent *event,
|
||||
gpointer user_data)
|
||||
{
|
||||
StyleSheetDialog *ss = (StyleSheetDialog *)user_data;
|
||||
// this cb allows the window size to be saved on closing with the X
|
||||
gnc_save_window_size (GNC_PREFS_GROUP, GTK_WINDOW(ss->toplevel));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void
|
||||
gnc_style_sheet_select_dialog_destroy_cb (GtkWidget *widget, gpointer user_data)
|
||||
{
|
||||
StyleSheetDialog *ss = (StyleSheetDialog *)user_data;
|
||||
|
||||
if (!ss)
|
||||
return;
|
||||
|
||||
gnc_unregister_gui_component (ss->component_id);
|
||||
|
||||
if (ss->toplevel)
|
||||
{
|
||||
gtk_widget_destroy (ss->toplevel);
|
||||
ss->toplevel = NULL;
|
||||
}
|
||||
gnc_style_sheet_dialog = NULL;
|
||||
g_free (ss);
|
||||
}
|
||||
|
||||
static void
|
||||
gnc_style_sheet_window_close_handler (gpointer user_data)
|
||||
{
|
||||
StyleSheetDialog *ss = (StyleSheetDialog *)user_data;
|
||||
g_return_if_fail (ss);
|
||||
|
||||
gnc_save_window_size (GNC_PREFS_GROUP, GTK_WINDOW(ss->toplevel));
|
||||
gtk_widget_destroy (ss->toplevel);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gnc_style_sheet_select_dialog_check_escape_cb (GtkWidget *widget,
|
||||
GdkEventKey *event,
|
||||
gpointer user_data)
|
||||
{
|
||||
if (event->keyval == GDK_KEY_Escape)
|
||||
{
|
||||
StyleSheetDialog * ss = (StyleSheetDialog *)user_data;
|
||||
gnc_close_gui_component (ss->component_id);
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static StyleSheetDialog *
|
||||
gnc_style_sheet_select_dialog_create(GtkWindow *parent)
|
||||
gnc_style_sheet_select_dialog_create (GtkWindow *parent)
|
||||
{
|
||||
StyleSheetDialog * ss = g_new0(StyleSheetDialog, 1);
|
||||
StyleSheetDialog * ss = g_new0 (StyleSheetDialog, 1);
|
||||
GtkBuilder * builder;
|
||||
GtkCellRenderer * renderer;
|
||||
GtkTreeSelection * selection;
|
||||
|
||||
builder = gtk_builder_new();
|
||||
gnc_builder_add_from_file (builder, "dialog-report.glade", "select_style_sheet_dialog");
|
||||
builder = gtk_builder_new ();
|
||||
gnc_builder_add_from_file (builder, "dialog-report.glade", "select_style_sheet_window");
|
||||
|
||||
ss->toplevel = GTK_WIDGET(gtk_builder_get_object (builder, "select_style_sheet_dialog"));
|
||||
ss->toplevel = GTK_WIDGET(gtk_builder_get_object (builder, "select_style_sheet_window"));
|
||||
|
||||
gtk_window_set_transient_for (GTK_WINDOW (ss->toplevel), GTK_WINDOW(parent));
|
||||
ss->session = gnc_get_current_session ();
|
||||
|
||||
// Set the name for this dialog so it can be easily manipulated with css
|
||||
gtk_widget_set_name (GTK_WIDGET(ss->toplevel), "gnc-id-style-sheet-select");
|
||||
@ -438,43 +508,60 @@ gnc_style_sheet_select_dialog_create(GtkWindow *parent)
|
||||
|
||||
ss->list_view = GTK_TREE_VIEW(gtk_builder_get_object (builder, "style_sheet_list_view"));
|
||||
ss->list_store = gtk_list_store_new (N_COLUMNS, G_TYPE_STRING, G_TYPE_POINTER, G_TYPE_POINTER);
|
||||
gtk_tree_view_set_model(ss->list_view, GTK_TREE_MODEL(ss->list_store));
|
||||
g_object_unref(ss->list_store);
|
||||
gtk_tree_view_set_model (ss->list_view, GTK_TREE_MODEL(ss->list_store));
|
||||
g_object_unref (ss->list_store);
|
||||
|
||||
renderer = gtk_cell_renderer_text_new ();
|
||||
gtk_tree_view_insert_column_with_attributes(ss->list_view, -1,
|
||||
_("Style Sheet Name"), renderer,
|
||||
"text", COLUMN_NAME,
|
||||
NULL);
|
||||
gtk_tree_view_insert_column_with_attributes (ss->list_view, -1,
|
||||
_("Style Sheet Name"), renderer,
|
||||
"text", COLUMN_NAME,
|
||||
NULL);
|
||||
|
||||
selection = gtk_tree_view_get_selection (ss->list_view);
|
||||
gtk_tree_selection_set_mode (selection, GTK_SELECTION_BROWSE);
|
||||
|
||||
g_signal_connect(ss->toplevel, "response",
|
||||
G_CALLBACK(gnc_style_sheet_select_dialog_response_cb), ss);
|
||||
g_signal_connect(ss->list_view, "event-after",
|
||||
G_CALLBACK(gnc_style_sheet_select_dialog_event_cb), ss);
|
||||
g_signal_connect (ss->list_view, "event-after",
|
||||
G_CALLBACK(gnc_style_sheet_select_dialog_event_cb), ss);
|
||||
|
||||
gnc_style_sheet_select_dialog_fill(ss);
|
||||
g_signal_connect (ss->toplevel, "destroy",
|
||||
G_CALLBACK(gnc_style_sheet_select_dialog_destroy_cb), ss);
|
||||
|
||||
gtk_widget_show_all(ss->toplevel);
|
||||
g_signal_connect (ss->toplevel, "delete-event",
|
||||
G_CALLBACK(gnc_style_sheet_select_dialog_delete_event_cb), ss);
|
||||
|
||||
g_object_unref(G_OBJECT(builder));
|
||||
g_signal_connect (ss->toplevel, "key-press-event",
|
||||
G_CALLBACK(gnc_style_sheet_select_dialog_check_escape_cb), ss);
|
||||
|
||||
gnc_style_sheet_select_dialog_fill (ss);
|
||||
|
||||
gtk_builder_connect_signals_full (builder, gnc_builder_connect_full_func, ss);
|
||||
g_object_unref (G_OBJECT(builder));
|
||||
return ss;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
gnc_style_sheet_dialog_open(GtkWindow *parent)
|
||||
gnc_style_sheet_dialog_open (GtkWindow *parent)
|
||||
{
|
||||
if (gnc_style_sheet_dialog)
|
||||
{
|
||||
gtk_window_present(GTK_WINDOW(gnc_style_sheet_dialog->toplevel));
|
||||
}
|
||||
gtk_window_present (GTK_WINDOW(gnc_style_sheet_dialog->toplevel));
|
||||
else
|
||||
{
|
||||
gnc_style_sheet_dialog =
|
||||
gnc_style_sheet_select_dialog_create(parent);
|
||||
gnc_style_sheet_select_dialog_create (parent);
|
||||
|
||||
/* register with component manager */
|
||||
gnc_style_sheet_dialog->component_id =
|
||||
gnc_register_gui_component (DIALOG_STYLE_SHEETS_CM_CLASS,
|
||||
NULL, //no refresh handler
|
||||
gnc_style_sheet_window_close_handler,
|
||||
gnc_style_sheet_dialog);
|
||||
|
||||
gnc_gui_component_set_session (gnc_style_sheet_dialog->component_id,
|
||||
gnc_style_sheet_dialog->session);
|
||||
|
||||
gnc_restore_window_size (GNC_PREFS_GROUP,
|
||||
GTK_WINDOW(gnc_style_sheet_dialog->toplevel),
|
||||
GTK_WINDOW(parent));
|
||||
gtk_widget_show_all (gnc_style_sheet_dialog->toplevel);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
/********************************************************************
|
||||
* dialog-report-style-sheet.h -- window for configuring HTML style *
|
||||
* sheets in GnuCash *
|
||||
* sheets in GnuCash *
|
||||
* Copyright (C) 2000 Bill Gribble <grib@billgribble.com> *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or *
|
||||
@ -26,6 +26,6 @@
|
||||
|
||||
typedef struct _stylesheetdialog StyleSheetDialog;
|
||||
|
||||
void gnc_style_sheet_dialog_open(GtkWindow *parent);
|
||||
void gnc_style_sheet_dialog_open (GtkWindow *parent);
|
||||
|
||||
#endif
|
||||
|
@ -275,7 +275,7 @@ static GtkActionEntry gnc_plugin_actions [] =
|
||||
|
||||
/* Other menu items */
|
||||
{
|
||||
"BusinessLinkOpenAction", NULL, N_("Business Links"), NULL,
|
||||
"BusinessLinkedDocsAction", NULL, N_("Business Linked Documents"), NULL,
|
||||
N_("View all Linked Business Documents"),
|
||||
G_CALLBACK (gnc_plugin_business_cmd_doclink)
|
||||
},
|
||||
|
@ -442,7 +442,7 @@ static action_toolbar_labels creditnote_action_tooltips[] = {
|
||||
{"BlankEntryAction", N_("Move to the blank entry at the bottom of the credit note")},
|
||||
{"ToolsProcessPaymentAction", N_("Enter a payment for the owner of this credit note") },
|
||||
{"ReportsCompanyReportAction", N_("Open a company report window for the owner of this credit note") },
|
||||
{"BusinessLinkAction", N_("_Manage Document Link...")},
|
||||
{"BusinessLinkAction", N_("Manage Document Link...")},
|
||||
{"BusinessLinkOpenAction", N_("Open Linked Document")},
|
||||
{NULL, NULL},
|
||||
};
|
||||
@ -1360,16 +1360,23 @@ gnc_plugin_page_invoice_cmd_link (GtkAction *action,
|
||||
|
||||
ret_uri = gnc_doclink_get_uri_dialog (parent, _("Manage Document Link"), uri);
|
||||
|
||||
if (ret_uri)
|
||||
has_uri = TRUE;
|
||||
|
||||
if (ret_uri && g_strcmp0 (uri, ret_uri) != 0)
|
||||
{
|
||||
GtkWidget *doclink_button =
|
||||
gnc_invoice_window_get_doclink_button (priv->iw);
|
||||
|
||||
if (doclink_button)
|
||||
if (g_strcmp0 (ret_uri, "") == 0)
|
||||
{
|
||||
if (g_strcmp0 (ret_uri, "") == 0)
|
||||
has_uri = FALSE;
|
||||
if (doclink_button)
|
||||
gtk_widget_hide (GTK_WIDGET(doclink_button));
|
||||
else
|
||||
}
|
||||
else
|
||||
{
|
||||
if (doclink_button)
|
||||
{
|
||||
gchar *display_uri =
|
||||
gnc_doclink_get_unescaped_just_uri (ret_uri);
|
||||
@ -1380,9 +1387,7 @@ gnc_plugin_page_invoice_cmd_link (GtkAction *action,
|
||||
}
|
||||
}
|
||||
gncInvoiceSetDocLink (invoice, ret_uri);
|
||||
has_uri = TRUE;
|
||||
}
|
||||
|
||||
// update the menu actions
|
||||
update_doclink_actions (GNC_PLUGIN_PAGE(plugin_page), has_uri);
|
||||
|
||||
|
@ -498,7 +498,7 @@ static GtkActionEntry gnc_plugin_page_register_actions [] =
|
||||
},
|
||||
{
|
||||
"GotoDateAction", "x-office-calendar", N_ ("_Go to Date"), "<primary>G",
|
||||
N_ ("Move to the split at specified date"),
|
||||
N_ ("Move to the split at the specified date"),
|
||||
G_CALLBACK (gnc_plugin_page_register_cmd_goto_date)
|
||||
},
|
||||
{
|
||||
@ -1955,7 +1955,7 @@ gnc_plugin_page_register_finish_pending (GncPluginPage* page)
|
||||
|
||||
if (!finish_scrub (page))
|
||||
return FALSE;
|
||||
|
||||
|
||||
reg_page = GNC_PLUGIN_PAGE_REGISTER (page);
|
||||
priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE (reg_page);
|
||||
reg = gnc_ledger_display_get_split_register (priv->ledger);
|
||||
|
@ -47,6 +47,7 @@
|
||||
#include "gnc-engine.h"
|
||||
#include "gnc-file.h"
|
||||
#include "gnc-hooks.h"
|
||||
#include "gncInvoice.h"
|
||||
#include "gfec.h"
|
||||
#include "gnc-main-window.h"
|
||||
#include "gnc-menu-extensions.h"
|
||||
@ -120,6 +121,7 @@ gnc_html_register_url_cb (const char *location, const char *label,
|
||||
Split * split = NULL;
|
||||
Account * account = NULL;
|
||||
Transaction * trans;
|
||||
GncInvoice * invoice;
|
||||
GList * node;
|
||||
GncGUID guid;
|
||||
QofInstance * entity = NULL;
|
||||
@ -180,6 +182,19 @@ gnc_html_register_url_cb (const char *location, const char *label,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
else if (strncmp ("invoice-doclink-guid=", location,
|
||||
strlen ("invoice-doclink-guid=")) == 0)
|
||||
{
|
||||
if (!validate_type("invoice-doclink-guid=", location, GNC_ID_INVOICE,
|
||||
result, &guid, &entity))
|
||||
return FALSE;
|
||||
|
||||
invoice = (GncInvoice *) entity;
|
||||
gnc_doclink_open_uri (gnc_ui_get_gtk_window (GTK_WIDGET (result->parent)),
|
||||
gncInvoiceGetDocLink (invoice));
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
else if (strncmp ("split-guid=", location, strlen ("split-guid=")) == 0)
|
||||
{
|
||||
if (!validate_type("split-guid=", location, GNC_ID_SPLIT, result, &guid, &entity))
|
||||
|
@ -107,7 +107,7 @@ ght_gnc_numeric_hash(gconstpointer v1)
|
||||
{
|
||||
gnc_numeric n1 = *(gnc_numeric *)v1;
|
||||
gdouble d1 = gnc_numeric_to_double(n1);
|
||||
return g_str_hash(&d1);
|
||||
return g_double_hash (&d1);
|
||||
}
|
||||
|
||||
typedef struct _sack_foreach_data_t
|
||||
@ -122,7 +122,8 @@ static void sack_foreach_func(gpointer key, gpointer value, gpointer user_data)
|
||||
gnc_numeric thisvalue = *(gnc_numeric *)key;
|
||||
|
||||
gnc_numeric reachable_value = gnc_numeric_add_fixed(thisvalue, data->split_value);
|
||||
data->reachable_list = g_list_append(data->reachable_list, g_memdup(&reachable_value, sizeof(gnc_numeric)));
|
||||
data->reachable_list = g_list_prepend
|
||||
(data->reachable_list, g_memdup (&reachable_value, sizeof (gnc_numeric)));
|
||||
PINFO(" Sack: found %s, added %s\n", gnc_numeric_to_string(thisvalue), gnc_numeric_to_string(reachable_value));
|
||||
}
|
||||
|
||||
@ -138,6 +139,8 @@ gnc_autoclear_window_ok_cb (GtkWidget *widget,
|
||||
|
||||
/* Value we have to reach */
|
||||
toclear_value = gnc_amount_edit_get_amount(data->end_value);
|
||||
if (gnc_reverse_balance(data->account))
|
||||
toclear_value = gnc_numeric_neg(toclear_value);
|
||||
toclear_value = gnc_numeric_convert(toclear_value, xaccAccountGetCommoditySCU(data->account), GNC_HOW_RND_NEVER);
|
||||
|
||||
/* Extract which splits are not cleared and compute the amount we have to clear */
|
||||
@ -151,7 +154,7 @@ gnc_autoclear_window_ok_cb (GtkWidget *widget,
|
||||
value = xaccSplitGetAmount (split);
|
||||
|
||||
if (recn == NREC)
|
||||
nc_list = g_list_append(nc_list, split);
|
||||
nc_list = g_list_prepend (nc_list, split);
|
||||
else
|
||||
toclear_value = gnc_numeric_sub_fixed(toclear_value, value);
|
||||
}
|
||||
@ -189,7 +192,8 @@ gnc_autoclear_window_ok_cb (GtkWidget *widget,
|
||||
g_hash_table_foreach (sack, sack_foreach_func, data);
|
||||
|
||||
/* Add the value of the split itself to the reachable_list */
|
||||
data->reachable_list = g_list_append(data->reachable_list, g_memdup(&split_value, sizeof(gnc_numeric)));
|
||||
data->reachable_list = g_list_prepend
|
||||
(data->reachable_list, g_memdup (&split_value, sizeof (gnc_numeric)));
|
||||
|
||||
/* Add everything to the sack, looking out for duplicates */
|
||||
for (node = data->reachable_list; node; node = node->next)
|
||||
@ -237,6 +241,7 @@ gnc_autoclear_window_ok_cb (GtkWidget *widget,
|
||||
/* We couldn't reconstruct the solution */
|
||||
PINFO(" Solution not unique.\n");
|
||||
gtk_label_set_text(data->status_label, _("Cannot uniquely clear splits. Found multiple possibilities."));
|
||||
gtk_editable_select_region (GTK_EDITABLE (data->end_value), 0, -1);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -244,6 +249,7 @@ gnc_autoclear_window_ok_cb (GtkWidget *widget,
|
||||
{
|
||||
PINFO(" No solution found.\n");
|
||||
gtk_label_set_text(data->status_label, _("The selected amount cannot be cleared."));
|
||||
gtk_editable_select_region (GTK_EDITABLE (data->end_value), 0, -1);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -301,6 +307,7 @@ autoClearWindow (GtkWidget *parent, Account *account)
|
||||
GtkBuilder *builder;
|
||||
AutoClearWindow *data;
|
||||
char *title;
|
||||
gnc_numeric after;
|
||||
|
||||
data = g_new0 (AutoClearWindow, 1);
|
||||
data->account = account;
|
||||
@ -326,7 +333,14 @@ autoClearWindow (GtkWidget *parent, Account *account)
|
||||
|
||||
label = GTK_LABEL(gtk_builder_get_object (builder, "end_label"));
|
||||
gtk_label_set_mnemonic_widget(label, GTK_WIDGET(data->end_value));
|
||||
|
||||
/* pre-fill with current balance */
|
||||
after = xaccAccountGetClearedBalance (data->account);
|
||||
if (gnc_reverse_balance(data->account))
|
||||
after = gnc_numeric_neg(after);
|
||||
gnc_amount_edit_set_amount (GNC_AMOUNT_EDIT (data->end_value), after);
|
||||
gtk_widget_grab_focus(GTK_WIDGET(data->end_value));
|
||||
gtk_editable_select_region (GTK_EDITABLE (data->end_value), 0, -1);
|
||||
|
||||
data->status_label = GTK_LABEL(gtk_builder_get_object (builder, "status_label"));
|
||||
|
||||
|
@ -22,6 +22,7 @@
|
||||
<child name="transfer" schema="org.gnucash.dialogs.transfer"/>
|
||||
<child name="business-doclink" schema="org.gnucash.dialogs.business-doclink"/>
|
||||
<child name="trans-doclink" schema="org.gnucash.dialogs.trans-doclink"/>
|
||||
<child name="style-sheet" schema="org.gnucash.dialogs.style-sheet"/>
|
||||
<child name="options" schema="org.gnucash.dialogs.options"/>
|
||||
</schema>
|
||||
|
||||
@ -258,6 +259,16 @@
|
||||
</key>
|
||||
</schema>
|
||||
|
||||
<schema id="org.gnucash.dialogs.style-sheet" path="/org/gnucash/dialogs/style-sheet/">
|
||||
<key type="(iiii)" name="last-geometry">
|
||||
<default>(-1,-1,-1,-1)</default>
|
||||
<summary>Last window position and size</summary>
|
||||
<description>This setting describes the size and position of the window when it was last closed.
|
||||
The numbers are the X and Y coordinates of the top left corner of the window
|
||||
followed by the width and height of the window.</description>
|
||||
</key>
|
||||
</schema>
|
||||
|
||||
<schema id="org.gnucash.dialogs.options" path="/org/gnucash/dialogs/options/">
|
||||
<key name="last-geometry" type="(iiii)">
|
||||
<default>(-1,-1,-1,-1)</default>
|
||||
|
@ -313,7 +313,7 @@
|
||||
<property name="can_focus">True</property>
|
||||
<property name="hexpand">True</property>
|
||||
<property name="invisible_char">●</property>
|
||||
<property name="text" translatable="yes">Cash In Lieu</property>
|
||||
<property name="text" translatable="yes" comments="Default memo text for the remains of a stock split">Cash in lieu</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
@ -406,7 +406,7 @@
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="title" translatable="yes">Cash in Lieu</property>
|
||||
<property name="title" translatable="yes" comments="Dialog title for the remains of a stock split">Cash In Lieu</property>
|
||||
<property name="has_padding">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
@ -589,19 +589,40 @@
|
||||
<placeholder/>
|
||||
</child>
|
||||
</object>
|
||||
<object class="GtkDialog" id="select_style_sheet_dialog">
|
||||
<object class="GtkWindow" id="select_style_sheet_window">
|
||||
<property name="can_focus">False</property>
|
||||
<property name="title" translatable="yes">Select HTML Style Sheet</property>
|
||||
<property name="default_width">300</property>
|
||||
<property name="default_height">200</property>
|
||||
<property name="type_hint">dialog</property>
|
||||
<child internal-child="vbox">
|
||||
<object class="GtkBox" id="dialog-vbox9">
|
||||
<child>
|
||||
<object class="GtkBox" id="hbox1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child internal-child="action_area">
|
||||
<object class="GtkButtonBox" id="dialog-action_area9">
|
||||
<child>
|
||||
<object class="GtkScrolledWindow" id="scrolledwindow">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<child>
|
||||
<object class="GtkTreeView" id="style_sheet_list_view">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="headers_visible">False</property>
|
||||
<property name="enable_search">False</property>
|
||||
<child internal-child="selection">
|
||||
<object class="GtkTreeSelection"/>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButtonBox" id="dialog-action_area">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="layout_style">end</property>
|
||||
@ -613,6 +634,7 @@
|
||||
<property name="can_default">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="use_underline">True</property>
|
||||
<signal name="clicked" handler="gnc_style_sheet_select_dialog_edit_cb" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
@ -628,6 +650,7 @@
|
||||
<property name="can_default">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="use_underline">True</property>
|
||||
<signal name="clicked" handler="gnc_style_sheet_select_dialog_new_cb" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
@ -643,6 +666,7 @@
|
||||
<property name="can_default">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="use_underline">True</property>
|
||||
<signal name="clicked" handler="gnc_style_sheet_select_dialog_delete_cb" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
@ -658,6 +682,7 @@
|
||||
<property name="can_default">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="use_underline">True</property>
|
||||
<signal name="clicked" handler="gnc_style_sheet_select_dialog_close_cb" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
@ -670,41 +695,11 @@
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="pack_type">end</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkScrolledWindow" id="scrolledwindow28">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="hscrollbar_policy">always</property>
|
||||
<property name="vscrollbar_policy">always</property>
|
||||
<child>
|
||||
<object class="GtkTreeView" id="style_sheet_list_view">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="headers_visible">False</property>
|
||||
<property name="enable_search">False</property>
|
||||
<child internal-child="selection">
|
||||
<object class="GtkTreeSelection" id="treeview-selection3"/>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">2</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<action-widgets>
|
||||
<action-widget response="3">edit_button</action-widget>
|
||||
<action-widget response="1">add_button</action-widget>
|
||||
<action-widget response="2">delete_button</action-widget>
|
||||
<action-widget response="-7">close_button</action-widget>
|
||||
</action-widgets>
|
||||
<child type="titlebar">
|
||||
<placeholder/>
|
||||
</child>
|
||||
|
@ -1,11 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Generated with glade 3.36.0 -->
|
||||
<!-- Generated with glade 3.22.2 -->
|
||||
<interface>
|
||||
<requires lib="gtk+" version="3.22"/>
|
||||
<object class="GtkDialog" id="auto_clear_start_dialog">
|
||||
<property name="can_focus">False</property>
|
||||
<property name="resizable">False</property>
|
||||
<property name="type_hint">dialog</property>
|
||||
<child type="titlebar">
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child internal-child="vbox">
|
||||
<object class="GtkBox" id="dialog-vbox6">
|
||||
<property name="visible">True</property>
|
||||
@ -68,8 +71,11 @@
|
||||
<object class="GtkLabel" id="label1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes"><b>Auto-Clear Information</b></property>
|
||||
<property name="label" translatable="yes"><b>Auto-Clear Information</b>
|
||||
Use this dialog if you want GnuCash to automatically find which transactions are cleared, given an ending balance. For example, said ending balance can be the current balance given by your online bank.</property>
|
||||
<property name="use_markup">True</property>
|
||||
<property name="wrap">True</property>
|
||||
<property name="max_width_chars">80</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
@ -143,8 +149,5 @@
|
||||
<action-widget response="-6">cancel_button</action-widget>
|
||||
<action-widget response="-5">ok_button</action-widget>
|
||||
</action-widgets>
|
||||
<child type="titlebar">
|
||||
<placeholder/>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
||||
|
@ -51,8 +51,13 @@ add_library (gnc-html
|
||||
${html_HEADERS}
|
||||
)
|
||||
|
||||
target_link_libraries(gnc-html gnc-engine gnc-gnome-utils
|
||||
PkgConfig::GTK3 PkgConfig::WEBKIT ${GUILE_LDFLAGS})
|
||||
target_link_libraries(gnc-html
|
||||
PRIVATE
|
||||
gnc-engine
|
||||
gnc-gnome-utils
|
||||
PkgConfig::GTK3
|
||||
PkgConfig::WEBKIT
|
||||
${GUILE_LDFLAGS})
|
||||
|
||||
target_compile_definitions(gnc-html PRIVATE -DG_LOG_DOMAIN=\"gnc.html\")
|
||||
|
||||
|
@ -107,23 +107,6 @@ gnc_price_cell_modify_verify (BasicCell *_cell,
|
||||
return;
|
||||
}
|
||||
|
||||
// gnc_basic_cell_set_value_internal doesn't like misplaced thousands separators
|
||||
// that can result from deletes, so remove them.
|
||||
for (const char *c = g_utf8_strchr (new_newval, -1, thousands_sep); c;
|
||||
c = g_utf8_strchr (c, -1, thousands_sep))
|
||||
{
|
||||
long len = g_utf8_strlen (new_newval, -1);
|
||||
long pos = g_utf8_pointer_to_offset (new_newval, c);
|
||||
char *start = g_utf8_substring (new_newval, 0, pos);
|
||||
char *end = g_utf8_substring (new_newval, ++pos, len);
|
||||
g_free (new_newval);
|
||||
if (cursor_position && *cursor_position >= pos)
|
||||
--*cursor_position;
|
||||
new_newval = g_strdup_printf ("%s%s", start, end);
|
||||
g_free (start);
|
||||
g_free (end);
|
||||
}
|
||||
|
||||
gnc_basic_cell_set_value_internal (_cell, new_newval);
|
||||
g_free (new_newval);
|
||||
*end_selection = *start_selection = *cursor_position;
|
||||
|
@ -155,6 +155,8 @@
|
||||
(cons 'datasets #())))
|
||||
(cons 'options (list
|
||||
(cons 'maintainAspectRatio #f)
|
||||
(cons 'animation (list
|
||||
(cons 'duration 0)))
|
||||
(cons 'chartArea (list
|
||||
(cons 'backgroundColor "#fffdf6")))
|
||||
(cons 'legend (list
|
||||
@ -265,12 +267,12 @@
|
||||
(cons 'backgroundColor (list-to-vec color))
|
||||
(cons 'borderColor (list-to-vec color)))))
|
||||
(match rest
|
||||
(() (gnc:html-chart-set!
|
||||
chart '(data datasets)
|
||||
(list->vector
|
||||
(append (vector->list
|
||||
(or (gnc:html-chart-get chart '(data datasets)) #()))
|
||||
(list newseries)))))
|
||||
(() (let* ((old-vec (gnc:html-chart-get chart '(data datasets)))
|
||||
(old-len (vector-length old-vec))
|
||||
(new-vec (make-vector (1+ old-len))))
|
||||
(vector-move-left! old-vec 0 old-len new-vec 0)
|
||||
(vector-set! new-vec old-len newseries)
|
||||
(gnc:html-chart-set! chart '(data datasets) new-vec)))
|
||||
((key val . rest) (loop rest (assq-set! newseries key (list-to-vec val)))))))
|
||||
|
||||
(define-public (gnc:html-chart-clear-data-series! chart)
|
||||
|
@ -48,6 +48,9 @@
|
||||
(define (gnc:transaction-doclink-anchor-text trans)
|
||||
(gnc:register-guid "trans-doclink-guid=" (gncTransGetGUID trans)))
|
||||
|
||||
(define (gnc:invoice-doclink-anchor-text invoice)
|
||||
(gnc:register-guid "invoice-doclink-guid=" (gncInvoiceReturnGUID invoice)))
|
||||
|
||||
(define (gnc:report-anchor-text report-id)
|
||||
(gnc-build-url URL-TYPE-REPORT
|
||||
(string-append "id=" (number->string report-id))
|
||||
@ -159,6 +162,11 @@
|
||||
(gnc:transaction-doclink-anchor-text trans)
|
||||
text)))
|
||||
|
||||
(define (gnc:html-invoice-doclink-anchor invoice text)
|
||||
(gnc:make-html-text (gnc:html-markup-anchor
|
||||
(gnc:invoice-doclink-anchor-text invoice)
|
||||
text)))
|
||||
|
||||
(define (gnc:html-price-anchor price value)
|
||||
(gnc:make-html-text (if price
|
||||
(gnc:html-markup-anchor
|
||||
|
@ -93,6 +93,7 @@
|
||||
(export gnc:html-split-anchor)
|
||||
(export gnc:html-transaction-anchor)
|
||||
(export gnc:html-transaction-doclink-anchor)
|
||||
(export gnc:html-invoice-doclink-anchor)
|
||||
(export gnc:html-price-anchor)
|
||||
(export gnc:customer-anchor-text)
|
||||
(export gnc:job-anchor-text)
|
||||
|
@ -749,6 +749,9 @@ also show overall period profit & loss."))
|
||||
((eq? report-type 'pnl) (list startdate enddate))
|
||||
(else (list enddate))))
|
||||
|
||||
(report-dates-vec (list->vector report-dates))
|
||||
(num-report-dates (vector-length report-dates-vec))
|
||||
|
||||
;; an alist of (cons account account-cols-data) whereby
|
||||
;; account-cols-data is a list of col-datum records
|
||||
(accounts-cols-data
|
||||
@ -810,9 +813,9 @@ also show overall period profit & loss."))
|
||||
monetary common-currency
|
||||
(cond
|
||||
((eq? price-source 'pricedb-latest) (current-time))
|
||||
((eq? col-idx 'overall-period) (last report-dates))
|
||||
((eq? report-type 'balsheet) (list-ref report-dates col-idx))
|
||||
((eq? report-type 'pnl) (list-ref report-dates (1+ col-idx))))))))
|
||||
((eq? col-idx 'overall-period) enddate)
|
||||
((eq? report-type 'balsheet) (vector-ref report-dates-vec col-idx))
|
||||
((eq? report-type 'pnl) (vector-ref report-dates-vec (1+ col-idx))))))))
|
||||
|
||||
;; the following function generates an gnc:html-text object
|
||||
;; to dump exchange rate for a particular column. From the
|
||||
@ -894,10 +897,9 @@ also show overall period profit & loss."))
|
||||
(let ((balances
|
||||
(fold (lambda (a b) (if (member (car a) accts) (cons (cdr a) b) b))
|
||||
'() alist)))
|
||||
(list->vector
|
||||
(if (null? balances)
|
||||
(map (const (adder)) report-dates)
|
||||
(apply map adder balances)))))
|
||||
(if (null? balances)
|
||||
(make-vector num-report-dates (adder))
|
||||
(list->vector (apply map adder balances)))))
|
||||
|
||||
(gnc:html-document-set-title!
|
||||
doc (with-output-to-string
|
||||
@ -992,7 +994,7 @@ also show overall period profit & loss."))
|
||||
(and-let* (common-currency
|
||||
(date (case price-source
|
||||
((pricedb-latest) (current-time))
|
||||
(else (list-ref report-dates col-idx))))
|
||||
(else (vector-ref report-dates-vec col-idx))))
|
||||
(asset-liability-balance
|
||||
(vector-ref asset-liability-balances col-idx))
|
||||
(asset-liability-basis
|
||||
@ -1009,7 +1011,7 @@ also show overall period profit & loss."))
|
||||
(lambda (col-idx)
|
||||
(let* ((date (case price-source
|
||||
((pricedb-latest) (current-time))
|
||||
(else (list-ref report-dates col-idx))))
|
||||
(else (vector-ref report-dates-vec col-idx))))
|
||||
(income-expense-balance
|
||||
(vector-ref income-expense-balances-with-closing col-idx)))
|
||||
(if (and common-currency
|
||||
@ -1034,7 +1036,7 @@ also show overall period profit & loss."))
|
||||
|
||||
(get-col-header-fn
|
||||
(lambda (accounts col-idx)
|
||||
(let* ((date (list-ref report-dates col-idx))
|
||||
(let* ((date (vector-ref report-dates-vec col-idx))
|
||||
(header (qof-print-date date))
|
||||
(cell (gnc:make-html-table-cell/markup
|
||||
"total-label-cell" header)))
|
||||
@ -1054,7 +1056,7 @@ also show overall period profit & loss."))
|
||||
(add-multicolumn-acct-table
|
||||
table title accounts
|
||||
maxindent get-cell-monetary-fn
|
||||
(iota (length report-dates))
|
||||
(iota num-report-dates)
|
||||
#:omit-zb-bals? omit-zb-bals?
|
||||
#:show-zb-accts? show-zb-accts?
|
||||
#:disable-account-indent? disable-account-indent?
|
||||
@ -1145,12 +1147,12 @@ also show overall period profit & loss."))
|
||||
(lambda (idx)
|
||||
(cond
|
||||
((eq? idx 'overall-period)
|
||||
(cons (car report-dates) (last report-dates)))
|
||||
((= idx (- (length report-dates) 2))
|
||||
(cons (list-ref report-dates idx) (last report-dates)))
|
||||
(cons startdate enddate))
|
||||
((= idx (- num-report-dates 2))
|
||||
(cons (vector-ref report-dates-vec idx) enddate))
|
||||
(else
|
||||
(cons (list-ref report-dates idx)
|
||||
(decdate (list-ref report-dates (1+ idx)) DayDelta))))))
|
||||
(cons (vector-ref report-dates-vec idx)
|
||||
(decdate (vector-ref report-dates-vec (1+ idx)) DayDelta))))))
|
||||
|
||||
(col-idx->monetarypair (lambda (balancelist idx)
|
||||
(if (eq? idx 'overall-period)
|
||||
@ -1224,9 +1226,9 @@ also show overall period profit & loss."))
|
||||
table title accounts
|
||||
maxindent get-cell-monetary-fn
|
||||
(append
|
||||
(iota (1- (length report-dates)))
|
||||
(iota (1- num-report-dates))
|
||||
(if (and include-overall-period?
|
||||
(> (length report-dates) 2))
|
||||
(> num-report-dates 2))
|
||||
'(overall-period)
|
||||
'()))
|
||||
#:omit-zb-bals? omit-zb-bals?
|
||||
|
@ -204,8 +204,8 @@
|
||||
(gnc:html-chart-set-y-axis-label! chart (gnc-commodity-get-mnemonic curr))
|
||||
|
||||
;; disable animation; with multiple accounts selected this report
|
||||
;; will create several charts, all will want to animate
|
||||
(gnc:html-chart-set! chart '(options animation duration) 0)
|
||||
;; will create several charts, all will want to animate. Initial
|
||||
;; animation is already disabled globally.
|
||||
(gnc:html-chart-set! chart '(options hover animationDuration) 0)
|
||||
(gnc:html-chart-set! chart '(options responsiveAnimationDuration) 0)
|
||||
(gnc:html-chart-set-title!
|
||||
|
@ -41,15 +41,14 @@
|
||||
;; options generator
|
||||
|
||||
(define (general-journal-options-generator)
|
||||
|
||||
|
||||
(let* ((options (gnc:report-template-new-options/report-guid regrptguid regrptname))
|
||||
(query (qof-query-create-for-splits))
|
||||
)
|
||||
|
||||
(query (qof-query-create-for-splits)))
|
||||
|
||||
(define (set-option! section name value)
|
||||
(gnc:option-set-default-value
|
||||
(gnc:lookup-option options section name) value))
|
||||
|
||||
|
||||
;; Match, by default, all non-void transactions ever recorded in
|
||||
;; all accounts.... Whether or not to match void transactions,
|
||||
;; however, may be of issue here. Since I don't know if the
|
||||
@ -59,9 +58,9 @@
|
||||
(xaccQueryAddClearedMatch
|
||||
query (logand CLEARED-ALL (lognot CLEARED-VOIDED)) QOF-QUERY-AND)
|
||||
(qof-query-set-sort-order query
|
||||
(list SPLIT-TRANS TRANS-DATE-POSTED)
|
||||
(list QUERY-DEFAULT-SORT)
|
||||
'())
|
||||
(list SPLIT-TRANS TRANS-DATE-POSTED)
|
||||
(list QUERY-DEFAULT-SORT)
|
||||
'())
|
||||
(qof-query-set-sort-increasing query #t #t #t)
|
||||
|
||||
(xaccQueryAddAccountMatch
|
||||
@ -81,9 +80,7 @@
|
||||
(list "journal" #t)
|
||||
(list "double" #t)
|
||||
(list "debit-string" (G_ "Debit"))
|
||||
(list "credit-string" (G_ "Credit"))
|
||||
)
|
||||
)
|
||||
(list "credit-string" (G_ "Credit"))))
|
||||
;; we'll leave query malloc'd in case this is required by the C side...
|
||||
|
||||
;; set options in the display tab...
|
||||
@ -103,23 +100,19 @@
|
||||
;; note the "Amount" multichoice option here
|
||||
(list (N_ "Amount") 'double)
|
||||
(list (N_ "Running Balance") #f)
|
||||
(list (N_ "Totals") #f)
|
||||
)
|
||||
)
|
||||
|
||||
options)
|
||||
)
|
||||
(list (N_ "Totals") #f)))
|
||||
|
||||
(set-option! gnc:pagename-general "Title" (G_ reportname))
|
||||
options))
|
||||
|
||||
;; report renderer
|
||||
|
||||
(define (general-journal-renderer report-obj)
|
||||
;; just delegate rendering to the Register Report renderer...
|
||||
(let* ((renderer (gnc:report-template-renderer/report-guid regrptguid #f))
|
||||
(doc (renderer report-obj)))
|
||||
(gnc:html-document-set-title! doc (G_ reportname))
|
||||
doc))
|
||||
(let ((renderer (gnc:report-template-renderer/report-guid regrptguid #f)))
|
||||
(renderer report-obj)))
|
||||
|
||||
(gnc:define-report
|
||||
(gnc:define-report
|
||||
'version 1
|
||||
'name reportname
|
||||
'report-guid "25455562bd234dd0b048ecc5a8af9e43"
|
||||
@ -129,4 +122,3 @@
|
||||
)
|
||||
|
||||
;; END
|
||||
|
||||
|
@ -34,6 +34,7 @@
|
||||
(use-modules (gnucash app-utils))
|
||||
(use-modules (gnucash report))
|
||||
(use-modules (srfi srfi-1))
|
||||
(use-modules (srfi srfi-26))
|
||||
|
||||
(define optname-from-date (N_ "Start Date"))
|
||||
(define optname-to-date (N_ "End Date"))
|
||||
|
@ -56,7 +56,8 @@
|
||||
(define credit-header (N_ "Credits"))
|
||||
(define debit-header (N_ "Debits"))
|
||||
(define balance-header (N_ "Balance"))
|
||||
(define linked-txns-header (N_ "Links"))
|
||||
(define doclink-header (N_ "Document Links"))
|
||||
(define linked-txns-header (N_ "Transaction Links"))
|
||||
|
||||
(define javascript "
|
||||
<script>
|
||||
@ -162,6 +163,8 @@
|
||||
(vector-ref columns-used 8))
|
||||
(define (bal-col columns-used)
|
||||
(vector-ref columns-used 9))
|
||||
(define (doclink-col columns-used)
|
||||
(vector-ref columns-used 10))
|
||||
|
||||
(define (num-cols columns-used section)
|
||||
(let* ((date? (date-col columns-used))
|
||||
@ -174,12 +177,14 @@
|
||||
(credit? (credit-col columns-used))
|
||||
(debit? (debit-col columns-used))
|
||||
(bal? (bal-col columns-used))
|
||||
(doclink? (doclink-col columns-used))
|
||||
(spacer? (or date? type? ref? desc? debit? credit?))
|
||||
(amt? (or credit? debit?))
|
||||
(cols-alist
|
||||
(list
|
||||
(list 'lhs-cols date? due? ref? type? desc? sale? tax? credit? debit? bal?)
|
||||
(list 'ptt-span date? due? ref? type? desc?)
|
||||
(list 'lhs-cols date? due? ref? type? desc? sale? tax? credit? debit? bal?
|
||||
doclink?)
|
||||
(list 'ptt-span date? due? ref? type? desc? doclink?)
|
||||
(list 'mid-spac spacer?)
|
||||
(list 'rhs-cols date? ref? type? desc? amt? amt?)
|
||||
(list 'rhs-span date? ref? type? desc?)))
|
||||
@ -194,7 +199,7 @@
|
||||
(map opt-val
|
||||
(list date-header due-date-header reference-header type-header
|
||||
desc-header sale-header tax-header debit-header credit-header
|
||||
balance-header))))
|
||||
balance-header doclink-header))))
|
||||
|
||||
(define (make-heading-list column-vector link-option acct-type)
|
||||
(let ((heading-list '())
|
||||
@ -210,6 +215,8 @@
|
||||
(addto! heading-list (G_ type-header)))
|
||||
(if (desc-col column-vector)
|
||||
(addto! heading-list (G_ desc-header)))
|
||||
(if (doclink-col column-vector)
|
||||
(addto! heading-list (C_ "Column header for 'Document Link'" "L")))
|
||||
(if (sale-col column-vector)
|
||||
(addto! heading-list (G_ sale-header)))
|
||||
(if (tax-col column-vector)
|
||||
@ -340,7 +347,7 @@
|
||||
;; Make a row list based on the visible columns
|
||||
;;
|
||||
(define (add-row table odd-row? column-vector date due-date ref type-str
|
||||
desc currency amt debit credit sale tax lhs-class
|
||||
desc doclink-invoice currency amt debit credit sale tax lhs-class
|
||||
link-option link-rows)
|
||||
(define nrows (if link-rows (length link-rows) 1))
|
||||
(define (link-data->cols link-data)
|
||||
@ -431,7 +438,12 @@
|
||||
(and due-date (qof-print-date due-date)))
|
||||
(addif (ref-col column-vector) ref)
|
||||
(addif (type-col column-vector) type-str)
|
||||
(addif (desc-col column-vector) desc)))
|
||||
(addif (desc-col column-vector) desc)
|
||||
(addif (doclink-col column-vector)
|
||||
(and doclink-invoice
|
||||
(gnc:html-invoice-doclink-anchor
|
||||
doclink-invoice
|
||||
(C_ "Column header for 'Document Link'" "L"))))))
|
||||
(map
|
||||
(lambda (str)
|
||||
(let ((cell (gnc:make-html-table-cell/size/markup
|
||||
@ -543,7 +555,7 @@
|
||||
payable? date-type currency)))))
|
||||
|
||||
(define (add-balance-row odd-row? total)
|
||||
(add-row table odd-row? used-columns start-date #f "" (G_ "Balance") ""
|
||||
(add-row table odd-row? used-columns start-date #f "" (G_ "Balance") "" #f
|
||||
currency total #f #f #f #f #f
|
||||
link-option (case link-option
|
||||
((none) '(()))
|
||||
@ -796,6 +808,7 @@
|
||||
(split->reference split)
|
||||
(split->type-str split payable?)
|
||||
(splits->desc (list split))
|
||||
(and (not (string-null? (gncInvoiceGetDocLink invoice))) invoice)
|
||||
currency (+ total value)
|
||||
(and (>= orig-value 0) (amount->anchor split orig-value))
|
||||
(and (< orig-value 0) (amount->anchor split (- orig-value)))
|
||||
@ -825,7 +838,7 @@
|
||||
(split->reference split)
|
||||
(split->type-str split payable?)
|
||||
(splits->desc (xaccTransGetAPARAcctSplitList txn #t))
|
||||
currency (+ total value)
|
||||
#f currency (+ total value)
|
||||
(and (>= orig-value 0) (amount->anchor split orig-value))
|
||||
(and (< orig-value 0) (amount->anchor split (- orig-value)))
|
||||
#f #f
|
||||
@ -929,6 +942,11 @@
|
||||
(N_ "Invoices show list of payments, payments show list of \
|
||||
invoices and amounts.")))))
|
||||
|
||||
(gnc:register-inv-option
|
||||
(gnc:make-simple-boolean-option
|
||||
(N_ "Display Columns") doclink-header
|
||||
"hd" (N_ "Display document link?") #f))
|
||||
|
||||
(gnc:register-inv-option
|
||||
(gnc:make-multichoice-option
|
||||
gnc:pagename-general optname-date-driver "k"
|
||||
|
@ -42,7 +42,7 @@
|
||||
<menuitem name="EmployeeProcessPayment" action="EmployeeProcessPaymentAction"/>
|
||||
</menu>
|
||||
|
||||
<menuitem name="BusinessLinkOpen" action="BusinessLinkOpenAction"/>
|
||||
<menuitem name="BusinessLinkOpen" action="BusinessLinkedDocsAction"/>
|
||||
|
||||
<placeholder name="BusinessPlaceholderTop"/>
|
||||
<separator name="Sep1"/>
|
||||
|
@ -10,7 +10,6 @@
|
||||
<separator name="EditSep2"/>
|
||||
<menuitem name="FileOpenAccount" action="FileOpenAccountAction"/>
|
||||
<menuitem name="FileOpenSubaccounts" action="FileOpenSubaccountsAction"/>
|
||||
<menuitem name="EditTaxOptions" action="EditTaxOptionsAction"/>
|
||||
</placeholder>
|
||||
</menu>
|
||||
<menu name="Actions" action="ActionsAction">
|
||||
|
@ -1681,6 +1681,9 @@ the option '~a'."))
|
||||
("Void Transactions" "Filter" "Void Transactions")
|
||||
("Account Substring" "Filter" "Account Name Filter")
|
||||
("Enable links" #f "Enable Links")
|
||||
;; new-owner-report.scm, renamed Oct 2020 to differentiate with
|
||||
;; Document Links:
|
||||
("Links" #f "Transaction Links")
|
||||
;; invoice.scm, renamed November 2018
|
||||
("Individual Taxes" #f "Use Detailed Tax Summary")
|
||||
;; income-gst-statement.scm
|
||||
|
@ -133,8 +133,10 @@ gulong gnc_prefs_register_cb (const char *group,
|
||||
if (prefsbackend && prefsbackend->register_cb)
|
||||
return (prefsbackend->register_cb) (group, pref_name, func, user_data);
|
||||
else
|
||||
{
|
||||
g_warning ("no preferences backend loaded, or the backend doesn't define register_cb, returning 0");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -17,12 +17,11 @@ add_library (gnc-module
|
||||
${gnc_module_HEADERS}
|
||||
)
|
||||
|
||||
target_link_libraries(gnc-module ${GUILE_LDFLAGS} ${GMODULE_LDFLAGS} ${GLIB2_LDFLAGS})
|
||||
target_link_libraries(gnc-module ${GMODULE_LDFLAGS} ${GLIB2_LDFLAGS})
|
||||
|
||||
target_compile_definitions (gnc-module PRIVATE -DG_LOG_DOMAIN=\"gnc.module\")
|
||||
|
||||
target_include_directories (gnc-module
|
||||
PRIVATE ${GUILE_INCLUDE_DIRS}
|
||||
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${CMAKE_SOURCE_DIR}/common
|
||||
${CMAKE_BINARY_DIR}/common # for config.h
|
||||
|
9236
po/en_GB.po
9236
po/en_GB.po
File diff suppressed because it is too large
Load Diff
9227
po/es_NI.po
9227
po/es_NI.po
File diff suppressed because it is too large
Load Diff
9322
po/kok@latin.po
9322
po/kok@latin.po
File diff suppressed because it is too large
Load Diff
9351
po/mni@bengali.po
9351
po/mni@bengali.po
File diff suppressed because it is too large
Load Diff
9278
po/pt_BR.po
9278
po/pt_BR.po
File diff suppressed because it is too large
Load Diff
9192
po/zh_CN.po
9192
po/zh_CN.po
File diff suppressed because it is too large
Load Diff
9216
po/zh_TW.po
9216
po/zh_TW.po
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user