Merge branch 'maint'

This commit is contained in:
Christopher Lam 2022-08-03 20:38:08 +08:00
commit 0b5a4cd298
173 changed files with 26121 additions and 24687 deletions

View File

@ -3,7 +3,7 @@ on: [push, pull_request]
permissions: {}
jobs:
ci_tests_mac:
runs-on: macos-10.15
runs-on: macos-latest
name: macOS CI Tests
env:
TZ: America/Los_Angeles

View File

@ -171,7 +171,7 @@ try:
invoice_customer.ApplyPayment(None, a6, GncNumeric(7,100),
GncNumeric(1), datetime.date.today(), "", "")
vendor_bill_returns = book.BillLoookupByID("7")
vendor_bill_returns = book.BillLookupByID("7")
assert( vendor_bill_returns.GetID() == "7" )
vendor_extract = vendor_bill_returns.GetOwner()
assert( vendor_extract.GetName() == new_vendor.GetName() )

View File

@ -112,15 +112,6 @@ class TestTransaction(TransactionSession):
self.trans.ClearReadOnly()
self.assertEqual( None, self.trans.GetReadOnly() )
def test_txntype(self):
self.assertEqual( '\x00', self.trans.GetTxnType() )
TYPE = 'I'
self.trans.SetTxnType(TYPE)
self.assertEqual( TYPE, self.trans.GetTxnType() )
TYPE = 'P'
self.trans.SetTxnType(TYPE)
self.assertEqual( TYPE, self.trans.GetTxnType() )
def test_num(self):
NUM = '5'
self.assertEqual( '', self.trans.GetNum() )

View File

@ -1,14 +1,14 @@
#**********************************************************************
# Gnu Cash to OpenOffice.org (gnuc2ooo.py)
#
# Makros for the download of GnuCash Data to OpenOffice.org Base
# Macros for the download of GnuCash Data to OpenOffice.org Base
#
# Makro SetGnuCashFilePaths:
# Macro SetGnuCashFilePaths:
# Set or change the filepaths of the (GnuCash) data source
# and of the new OpenOffice.org database that will be created
# in this makro though still empty
# in this macro though still empty
#
# Makro fillGnuCashDB:
# Macro fillGnuCashDB:
# Download data from the GnuCash data source to OpenOffice.org
# Base
#
@ -35,7 +35,7 @@
#
#**********************************************************************
# Acknowledgements: Special thanks go to the authors on OpenOffice.org
# makro programming Roberto Benitez(http://www.baseprogramming.com) and
# macro programming Roberto Benitez(http://www.baseprogramming.com) and
# Andrew Pitonyak (http://www.pitonyak.org)
#**********************************************************************
# Changes
@ -85,8 +85,8 @@ PathSettings = smgr.createInstanceWithContext(
# ************************** PROLOG ***************************************
from com.sun.star.ui.dialogs.TemplateDescription import FILEOPEN_SIMPLE, FILESAVE_AUTOEXTENSION
lcodec = locale.getdefaultlocale()[1]
set_makro = "SetGnuCashFilePaths"
settings_textentrance = "#This file was generated by OpenOfficeMakro: "
set_macro = "SetGnuCashFilePaths"
settings_textentrance = "#This file was generated by OpenOfficeMacro: "
settings_textinp = "GnuCashDatafile: "
settings_textoutp = "Registered Database in Openoffice.org: "
# Trace / Error - Information
@ -178,7 +178,7 @@ def exec_SetGnuCashFilePaths():
else:
return None
settings = open(settings_filepath(), 'w')
entrance_line = settings_textentrance + set_makro + '\n'
entrance_line = settings_textentrance + set_macro + '\n'
settings.write(entrance_line)
settings.write(settings_textinp)
settings.write(GCFile.encode(lcodec) + '\n')
@ -194,7 +194,7 @@ def exec_SetGnuCashFilePaths():
settings.close()
MessageBox('A new Openoffice.org database has been created.\n' +
'To fill with data please run makro "fillGnuCashDB."',
'To fill with data please run macro "fillGnuCashDB."',
MsgType="infobox")
def read_filepaths():
@ -630,7 +630,7 @@ def exec_fillGnuCashDB():
filepaths = read_filepaths()
if not filepaths:
MessageBox('Reading filepaths not successful.\n' +
'Please run makro ' + '"' + set_makro + '"', MsgType="errorbox")
'Please run macro ' + '"' + set_macro + '"', MsgType="errorbox")
return False
gcfile = filepaths[0]

View File

@ -78,7 +78,7 @@ struct _GNCGeneralSearchPrivate
G_DEFINE_TYPE_WITH_PRIVATE(GNCGeneralSearch, gnc_general_search, GTK_TYPE_BOX)
#define _PRIVATE(o) \
((GNCGeneralSearchPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_GENERAL_SEARCH))
((GNCGeneralSearchPrivate*)gnc_general_search_get_instance_private((GNCGeneralSearch*)o))
static GtkBoxClass *parent_class;
static guint general_search_signals[LAST_SIGNAL];

View File

@ -61,7 +61,7 @@ struct _GNCSearchAccountPrivate
G_DEFINE_TYPE_WITH_PRIVATE(GNCSearchAccount, gnc_search_account, GNC_TYPE_SEARCH_CORE_TYPE)
#define _PRIVATE(o) \
((GNCSearchAccountPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_SEARCH_ACCOUNT))
((GNCSearchAccountPrivate*)gnc_search_account_get_instance_private((GNCSearchAccount*)o))
static GNCSearchCoreTypeClass *parent_class;

View File

@ -56,7 +56,7 @@ struct _GNCSearchBooleanPrivate
G_DEFINE_TYPE_WITH_PRIVATE(GNCSearchBoolean, gnc_search_boolean, GNC_TYPE_SEARCH_CORE_TYPE)
#define _PRIVATE(o) \
((GNCSearchBooleanPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_SEARCH_BOOLEAN))
((GNCSearchBooleanPrivate*)gnc_search_boolean_get_instance_private((GNCSearchBoolean*)o))
static GNCSearchCoreTypeClass *parent_class;

View File

@ -58,7 +58,7 @@ struct _GNCSearchCoreTypePrivate
G_DEFINE_TYPE_WITH_PRIVATE(GNCSearchCoreType, gnc_search_core_type, G_TYPE_OBJECT)
#define _PRIVATE(o) \
((GNCSearchCoreTypePrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_SEARCH_CORE_TYPE))
((GNCSearchCoreTypePrivate*)gnc_search_core_type_get_instance_private((GNCSearchCoreType*)o))
static GObjectClass *parent_class;

View File

@ -60,7 +60,7 @@ struct _GNCSearchDatePrivate
G_DEFINE_TYPE_WITH_PRIVATE(GNCSearchDate, gnc_search_date, GNC_TYPE_SEARCH_CORE_TYPE)
#define _PRIVATE(o) \
((GNCSearchDatePrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_SEARCH_DATE))
((GNCSearchDatePrivate*)gnc_search_date_get_instance_private((GNCSearchDate*)o))
static GNCSearchCoreTypeClass *parent_class;

View File

@ -61,7 +61,7 @@ struct _GNCSearchDoublePrivate
G_DEFINE_TYPE_WITH_PRIVATE(GNCSearchDouble, gnc_search_double, GNC_TYPE_SEARCH_CORE_TYPE)
#define _PRIVATE(o) \
((GNCSearchDoublePrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_SEARCH_DOUBLE))
((GNCSearchDoublePrivate*)gnc_search_double_get_instance_private((GNCSearchDouble*)o))
static GNCSearchCoreTypeClass *parent_class;

View File

@ -62,7 +62,7 @@ struct _GNCSearchInt64Private
G_DEFINE_TYPE_WITH_PRIVATE(GNCSearchInt64, gnc_search_int64, GNC_TYPE_SEARCH_CORE_TYPE)
#define _PRIVATE(o) \
((GNCSearchInt64Private*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_SEARCH_INT64))
((GNCSearchInt64Private*)gnc_search_int64_get_instance_private((GNCSearchInt64*)o))
static GNCSearchCoreTypeClass *parent_class;

View File

@ -62,7 +62,7 @@ struct _GNCSearchNumericPrivate
G_DEFINE_TYPE_WITH_PRIVATE(GNCSearchNumeric, gnc_search_numeric, GNC_TYPE_SEARCH_CORE_TYPE)
#define _PRIVATE(o) \
((GNCSearchNumericPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_SEARCH_NUMERIC))
((GNCSearchNumericPrivate*)gnc_search_numeric_get_instance_private((GNCSearchNumeric*)o))
static GNCSearchCoreTypeClass *parent_class;

View File

@ -58,7 +58,7 @@ struct _GNCSearchReconciledPrivate
G_DEFINE_TYPE_WITH_PRIVATE(GNCSearchReconciled, gnc_search_reconciled, GNC_TYPE_SEARCH_CORE_TYPE)
#define _PRIVATE(o) \
((GNCSearchReconciledPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_SEARCH_RECONCILED))
((GNCSearchReconciledPrivate*)gnc_search_reconciled_get_instance_private((GNCSearchReconciled*)o))
static GNCSearchCoreTypeClass *parent_class;

View File

@ -60,7 +60,7 @@ struct _GNCSearchStringPrivate
G_DEFINE_TYPE_WITH_PRIVATE(GNCSearchString, gnc_search_string, GNC_TYPE_SEARCH_CORE_TYPE)
#define _PRIVATE(o) \
((GNCSearchStringPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_SEARCH_STRING))
((GNCSearchStringPrivate*)gnc_search_string_get_instance_private((GNCSearchString*)o))
static GNCSearchCoreTypeClass *parent_class;

View File

@ -45,7 +45,7 @@
#define GNC_RESPONSE_BACK 2
/* Callbacks */
void gnc_totd_dialog_response_cb (GtkDialog *dialog, gint reponse, gpointer user_data);
void gnc_totd_dialog_response_cb (GtkDialog *dialog, gint response, gpointer user_data);
void gnc_totd_dialog_startup_toggled_cb (GtkToggleButton *button, gpointer user_data);
/* The Tips */

View File

@ -204,10 +204,11 @@ gas_populate_list (GNCAccountSel *gas)
GtkEntry *entry;
gint i, active = -1;
GList *accts, *ptr;
gchar *currentSel, *name;
const gchar *currentSel;
gchar *name;
entry = GTK_ENTRY(gtk_bin_get_child (GTK_BIN(gas->combo)));
currentSel = gtk_editable_get_chars (GTK_EDITABLE(entry), 0, -1 );
currentSel = gtk_entry_get_text (entry);
g_signal_handlers_block_by_func (gas->combo, combo_changed_cb , gas);
@ -244,8 +245,6 @@ gas_populate_list (GNCAccountSel *gas)
g_signal_handlers_unblock_by_func (gas->combo, combo_changed_cb , gas);
g_list_free (atnd.outList);
if (currentSel)
g_free (currentSel);
}
static void

View File

@ -93,7 +93,7 @@ typedef struct _GNCCurrencyEditPrivate
G_DEFINE_TYPE_WITH_PRIVATE(GNCCurrencyEdit, gnc_currency_edit, GTK_TYPE_COMBO_BOX)
#define GET_PRIVATE(o) \
((GNCCurrencyEditPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_CURRENCY_EDIT))
((GNCCurrencyEditPrivate*)gnc_currency_edit_get_instance_private((GNCCurrencyEdit*)o))
/** @name Basic Object Implementation */
/** @{ */

View File

@ -77,7 +77,7 @@ struct _GNCDateFormatPrivate
};
#define GNC_DATE_FORMAT_GET_PRIVATE(o) \
((GNCDateFormatPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_DATE_FORMAT))
((GNCDateFormatPrivate*)gnc_date_format_get_instance_private((GNCDateFormat*)o))
static guint date_format_signals [LAST_SIGNAL] = { 0 };

View File

@ -818,8 +818,11 @@ gdc_free_all_mark_data(GncDenseCal *dcal)
/* Remove the old mark data. */
for (l = dcal->markData; l; l = l->next)
{
g_list_free(((gdc_mark_data*)l->data)->ourMarks);
g_free((gdc_mark_data*)l->data);
gdc_mark_data *mark = l->data;
g_list_free (mark->ourMarks);
g_free (mark->name);
g_free (mark->info);
g_free (mark);
}
g_list_free(dcal->markData);
dcal->markData = NULL;
@ -902,13 +905,14 @@ gnc_dense_cal_draw_to_buffer(GncDenseCal *dcal)
cairo_t *cr;
gchar *primary_color_class, *secondary_color_class, *marker_color_class;
timer = g_timer_new();
DEBUG("drawing");
widget = GTK_WIDGET(dcal);
if (!dcal->surface)
return;
timer = g_timer_new();
g_timer_start(timer);
cr = cairo_create (dcal->surface);
layout = gtk_widget_create_pango_layout(GTK_WIDGET(dcal), NULL);
@ -1885,26 +1889,22 @@ cleanup:
static void
gdc_add_markings(GncDenseCal *cal)
{
GList *tags;
tags = gnc_dense_cal_model_get_contained(cal->model);
for (; tags != NULL; tags = tags->next)
{
guint tag = GPOINTER_TO_UINT(tags->data);
gdc_add_tag_markings(cal, tag);
}
GList *tags = gnc_dense_cal_model_get_contained(cal->model);
for (GList *n = tags; n; n = n->next)
gdc_add_tag_markings(cal, GPOINTER_TO_UINT(n->data));
g_list_free(tags);
}
static void
gdc_remove_markings(GncDenseCal *cal)
{
GList *tags;
tags = gnc_dense_cal_model_get_contained(cal->model);
for (; tags != NULL; tags = tags->next)
{
guint tag = GPOINTER_TO_UINT(tags->data);
gdc_mark_remove(cal, tag, FALSE);
}
GList *tags = gnc_dense_cal_model_get_contained(cal->model);
for (GList *n = tags; n; n = n->next)
gdc_mark_remove(cal, GPOINTER_TO_UINT(n->data), FALSE);
g_list_free(tags);
}
@ -2048,6 +2048,8 @@ gdc_mark_remove(GncDenseCal *dcal, guint mark_to_remove, gboolean redraw)
}
g_list_free(mark_data->ourMarks);
dcal->markData = g_list_remove(dcal->markData, mark_data);
g_free (mark_data->name);
g_free (mark_data->info);
g_free(mark_data);
if (redraw)

View File

@ -98,7 +98,7 @@ GNC_DEFINE_TYPE_WITH_CODE(GncEmbeddedWindow, gnc_embedded_window, GTK_TYPE_BOX,
gnc_window_embedded_window_init))
#define GNC_EMBEDDED_WINDOW_GET_PRIVATE(o) \
((GncEmbeddedWindowPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_EMBEDDED_WINDOW))
((GncEmbeddedWindowPrivate*)gnc_embedded_window_get_instance_private((GncEmbeddedWindow*)o))
/** A holding place for all the signals generated by the embedded window
* code. */

View File

@ -184,6 +184,7 @@ static void gnc_main_window_cmd_view_refresh (GtkAction *action, GncMainWindow *
static void gnc_main_window_cmd_view_toolbar (GtkAction *action, GncMainWindow *window);
static void gnc_main_window_cmd_view_summary (GtkAction *action, GncMainWindow *window);
static void gnc_main_window_cmd_view_statusbar (GtkAction *action, GncMainWindow *window);
static void gnc_main_window_cmd_view_tab_position (GtkAction *action, GtkRadioAction *current, GncMainWindow *window);
static void gnc_main_window_cmd_actions_reset_warnings (GtkAction *action, GncMainWindow *window);
static void gnc_main_window_cmd_actions_rename_page (GtkAction *action, GncMainWindow *window);
static void gnc_main_window_cmd_window_new (GtkAction *action, GncMainWindow *window);
@ -262,7 +263,7 @@ GNC_DEFINE_TYPE_WITH_CODE(GncMainWindow, gnc_main_window, GTK_TYPE_WINDOW,
gnc_window_main_window_init))
#define GNC_MAIN_WINDOW_GET_PRIVATE(o) \
((GncMainWindowPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_MAIN_WINDOW))
((GncMainWindowPrivate*)gnc_main_window_get_instance_private((GncMainWindow*)o))
/** This data structure maintains information about one action groups
* that has been installed in this window. */
@ -357,6 +358,7 @@ static GtkActionEntry gnc_menu_actions [] =
/* View menu */
{ "ViewTabPositionAction", NULL, N_("Tab P_osition"), NULL, NULL, NULL },
{
"ViewSortByAction", nullptr, N_("_Sort By..."), nullptr,
N_("Select sorting criteria for this page view"), nullptr
@ -442,6 +444,32 @@ static GtkToggleActionEntry toggle_actions [] =
/** The number of toggle actions provided by the main window. */
static guint n_toggle_actions = G_N_ELEMENTS (toggle_actions);
/** An array of all of the radio actions provided by the main window
* for tab positions. */
static GtkRadioActionEntry tab_pos_radio_entries [] =
{
{
"ViewTabPositionTopAction", NULL, N_("To_p"), NULL,
N_("Display the notebook tabs at the top of the window."), GTK_POS_TOP
},
{
"ViewTabPositionBottomAction", NULL, N_("B_ottom"), NULL,
N_("Display the notebook tabs at the bottom of the window."), GTK_POS_BOTTOM
},
{
"ViewTabPositionLeftAction", NULL, N_("_Left"), NULL,
N_("Display the notebook tabs at the left of the window."), GTK_POS_LEFT
},
{
"ViewTabPositionRightAction", NULL, N_("_Right"), NULL,
N_("Display the notebook tabs at the right of the window."), GTK_POS_RIGHT
},
};
/** The number of radio actions provided by the main window for tab
* positions. */
static guint n_tab_pos_radio_entries = G_N_ELEMENTS (tab_pos_radio_entries);
#ifndef MAC_INTEGRATION
/** An array of all of the radio action provided by the main window
* code. */
@ -2144,9 +2172,39 @@ gnc_main_window_update_tab_color (gpointer gsettings, gchar *pref, gpointer user
}
/** Set the tab label ellipsize value. The special check for a zero
* value handles the case where a user hasn't set a tab width and
* the preference default isn't detected.
/** This data structure allows the passing of the tab width and
* whether the tab layout is on the left or right.
*/
typedef struct
{
gint tab_width;
gboolean tabs_left_right;
} TabWidth;
static TabWidth *
populate_tab_width_struct (void)
{
TabWidth *tw;
tw = g_new0 (TabWidth, 1);
tw->tab_width = gnc_prefs_get_float (GNC_PREFS_GROUP_GENERAL, GNC_PREF_TAB_WIDTH);
tw->tabs_left_right = gnc_prefs_get_bool (GNC_PREFS_GROUP_GENERAL, GNC_PREF_TAB_POSITION_LEFT) ||
gnc_prefs_get_bool (GNC_PREFS_GROUP_GENERAL, GNC_PREF_TAB_POSITION_RIGHT);
return tw;
}
/** Set the tab label ellipsize value.
* When the tabs are on the left or right, the label width is set to
* the tab_width value. Doing this maintains a steady notepad header
* width for the tabs.
*
* When the tabs are on the top or bottom, the label width is set to
* the number of characters when shorter than tab_width so they take
* up less room.
*
* The special check for a zero value handles the case where a user
* hasn't set a tab width and the preference default isn't detected.
*
* @internal
*
@ -2154,9 +2212,11 @@ gnc_main_window_update_tab_color (gpointer gsettings, gchar *pref, gpointer user
*
* @param tab_width Tab width the user has set in preferences.
*
* @param tab_left_right Whether the tab layout is on the left or right.
*
*/
static void
gnc_main_window_set_tab_ellipsize (GtkWidget *label, gint tab_width)
gnc_main_window_set_tab_ellipsize (GtkWidget *label, gint tab_width, gboolean tab_left_right)
{
const gchar *lab_text = gtk_label_get_text (GTK_LABEL(label));
@ -2165,7 +2225,11 @@ gnc_main_window_set_tab_ellipsize (GtkWidget *label, gint tab_width)
gint text_length = g_utf8_strlen (lab_text, -1);
if (text_length < tab_width)
{
gtk_label_set_width_chars (GTK_LABEL(label), text_length);
if (tab_left_right) // tabs position is left or right
gtk_label_set_width_chars (GTK_LABEL(label), tab_width);
else // tabs position is top or bottom
gtk_label_set_width_chars (GTK_LABEL(label), text_length);
gtk_label_set_ellipsize (GTK_LABEL(label), PANGO_ELLIPSIZE_NONE);
}
else
@ -2194,18 +2258,20 @@ gnc_main_window_set_tab_ellipsize (GtkWidget *label, gint tab_width)
*/
static void
gnc_main_window_update_tab_width_one_page (GncPluginPage *page,
gpointer user_data)
gpointer user_data)
{
auto new_value{static_cast<int*>(user_data)};
auto tw{static_cast<TabWidth*>(user_data)};
ENTER("page %p, visible %d", page, *new_value);
auto label{static_cast<GtkWidget*>(g_object_get_data(G_OBJECT (page), PLUGIN_PAGE_TAB_LABEL))};
ENTER("page %p, tab width %d, tabs on left or right %d",
page, tw->tab_width, tw->tabs_left_right);
auto label{static_cast<GtkWidget *>(g_object_get_data(G_OBJECT (page), PLUGIN_PAGE_TAB_LABEL))};
if (!label)
{
LEAVE("no label");
return;
}
gnc_main_window_set_tab_ellipsize (label, *new_value);
gnc_main_window_set_tab_ellipsize (label, tw->tab_width, tw->tabs_left_right);
LEAVE(" ");
}
@ -2225,13 +2291,15 @@ gnc_main_window_update_tab_width_one_page (GncPluginPage *page,
static void
gnc_main_window_update_tab_width (gpointer prefs, gchar *pref, gpointer user_data)
{
gint new_value;
TabWidth *tw;
ENTER(" ");
new_value = gnc_prefs_get_float (GNC_PREFS_GROUP_GENERAL, GNC_PREF_TAB_WIDTH);
gnc_main_window_foreach_page(
gnc_main_window_update_tab_width_one_page,
&new_value);
tw = populate_tab_width_struct ();
gnc_main_window_foreach_page (gnc_main_window_update_tab_width_one_page, tw);
g_free (tw);
LEAVE(" ");
}
@ -2324,7 +2392,7 @@ main_window_update_page_name (GncPluginPage *page,
GncMainWindowPrivate *priv;
GtkWidget *label, *entry;
gchar *name, *old_page_name, *old_page_long_name;
gint lab_width;
TabWidth *tw;
ENTER(" ");
@ -2364,8 +2432,9 @@ main_window_update_page_name (GncPluginPage *page,
gtk_label_set_text(GTK_LABEL(label), name);
/* Adjust the label width for new text */
lab_width = gnc_prefs_get_float (GNC_PREFS_GROUP_GENERAL, GNC_PREF_TAB_WIDTH);
gnc_main_window_update_tab_width_one_page (page, &lab_width);
tw = populate_tab_width_struct ();
gnc_main_window_update_tab_width_one_page (page, tw);
g_free (tw);
/* Update Tooltip on notebook Tab */
if (old_page_long_name && old_page_name
@ -3178,7 +3247,7 @@ gnc_main_window_open_page (GncMainWindow *window,
const gchar *icon, *text, *color_string, *lab_text;
GtkWidget *image;
GList *tmp;
gint width;
TabWidth *tw;
ENTER("window %p, page %p", window, page);
if (window)
@ -3222,13 +3291,14 @@ gnc_main_window_open_page (GncMainWindow *window,
/*
* The page tab.
*/
width = gnc_prefs_get_float(GNC_PREFS_GROUP_GENERAL, GNC_PREF_TAB_WIDTH);
icon = GNC_PLUGIN_PAGE_GET_CLASS(page)->tab_icon;
lab_text = gnc_plugin_page_get_page_name(page);
label = gtk_label_new (lab_text);
g_object_set_data (G_OBJECT (page), PLUGIN_PAGE_TAB_LABEL, label);
gnc_main_window_set_tab_ellipsize (label, width);
tw = populate_tab_width_struct ();
gnc_main_window_update_tab_width_one_page (page, tw);
g_free (tw);
gtk_widget_show (label);
@ -3581,12 +3651,21 @@ gnc_main_window_update_tab_position (gpointer prefs, gchar *pref, gpointer user_
GncMainWindow *window;
GtkPositionType position = GTK_POS_TOP;
GncMainWindowPrivate *priv;
GtkAction *first_action;
GtkAction *position_action;
gsize i;
g_return_if_fail (GNC_IS_MAIN_WINDOW(user_data));
window = GNC_MAIN_WINDOW(user_data);
ENTER ("window %p", window);
/* Ignore notification of the preference that is being set to false when
* the choice of tab position changes. */
if (pref && !gnc_prefs_get_bool (GNC_PREFS_GROUP_GENERAL, pref))
return;
if (gnc_prefs_get_bool (GNC_PREFS_GROUP_GENERAL, GNC_PREF_TAB_POSITION_BOTTOM))
position = GTK_POS_BOTTOM;
else if (gnc_prefs_get_bool (GNC_PREFS_GROUP_GENERAL, GNC_PREF_TAB_POSITION_LEFT))
@ -3597,6 +3676,28 @@ gnc_main_window_update_tab_position (gpointer prefs, gchar *pref, gpointer user_
priv = GNC_MAIN_WINDOW_GET_PRIVATE (window);
gtk_notebook_set_tab_pos (GTK_NOTEBOOK (priv->notebook), position);
/* Groups of radio actions use the first action for the callback and all
* change events so block/unblock signals on the first radio action. */
first_action = gtk_action_group_get_action (priv->action_group,
tab_pos_radio_entries[0].name);
for (i = n_tab_pos_radio_entries - 1; i > 0; i--)
if (tab_pos_radio_entries[i].value == position)
break;
position_action = gtk_action_group_get_action (priv->action_group,
tab_pos_radio_entries[i].name);
g_signal_handlers_block_by_func (G_OBJECT (first_action),
(gpointer)gnc_main_window_cmd_view_tab_position,
window);
gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (position_action), TRUE);
g_signal_handlers_unblock_by_func (G_OBJECT (first_action),
(gpointer)gnc_main_window_cmd_view_tab_position,
window);
gnc_main_window_update_tab_width (NULL, (char*)GNC_PREF_TAB_WIDTH, NULL);
LEAVE ("");
}
@ -3849,6 +3950,12 @@ gnc_main_window_setup_window (GncMainWindow *window)
g_assert(merge_id || error);
if (merge_id)
{
gtk_action_group_add_radio_actions (priv->action_group,
tab_pos_radio_entries,
n_tab_pos_radio_entries,
0,
G_CALLBACK(gnc_main_window_cmd_view_tab_position),
window);
gtk_window_add_accel_group (GTK_WINDOW (window),
gtk_ui_manager_get_accel_group(window->ui_merge));
gtk_ui_manager_ensure_update (window->ui_merge);
@ -4573,6 +4680,45 @@ gnc_main_window_cmd_window_move_page (GtkAction *action, GncMainWindow *window)
LEAVE("page moved");
}
static void
gnc_main_window_cmd_view_tab_position (GtkAction *action,
GtkRadioAction *current,
GncMainWindow *window)
{
auto value{static_cast<GtkPositionType>(gtk_radio_action_get_current_value(current))};
if (value != GTK_POS_TOP && gnc_prefs_get_bool (GNC_PREFS_GROUP_GENERAL, GNC_PREF_TAB_POSITION_TOP))
gnc_prefs_set_bool (GNC_PREFS_GROUP_GENERAL, GNC_PREF_TAB_POSITION_TOP, FALSE);
if (value != GTK_POS_BOTTOM && gnc_prefs_get_bool (GNC_PREFS_GROUP_GENERAL, GNC_PREF_TAB_POSITION_BOTTOM))
gnc_prefs_set_bool (GNC_PREFS_GROUP_GENERAL, GNC_PREF_TAB_POSITION_BOTTOM, FALSE);
if (value != GTK_POS_LEFT && gnc_prefs_get_bool (GNC_PREFS_GROUP_GENERAL, GNC_PREF_TAB_POSITION_LEFT))
gnc_prefs_set_bool (GNC_PREFS_GROUP_GENERAL, GNC_PREF_TAB_POSITION_LEFT, FALSE);
if (value != GTK_POS_RIGHT && gnc_prefs_get_bool (GNC_PREFS_GROUP_GENERAL, GNC_PREF_TAB_POSITION_RIGHT))
gnc_prefs_set_bool (GNC_PREFS_GROUP_GENERAL, GNC_PREF_TAB_POSITION_RIGHT, FALSE);
switch (value)
{
case GTK_POS_TOP:
gnc_prefs_set_bool (GNC_PREFS_GROUP_GENERAL, GNC_PREF_TAB_POSITION_TOP, TRUE);
break;
case GTK_POS_BOTTOM:
gnc_prefs_set_bool (GNC_PREFS_GROUP_GENERAL, GNC_PREF_TAB_POSITION_BOTTOM, TRUE);
break;
case GTK_POS_LEFT:
gnc_prefs_set_bool (GNC_PREFS_GROUP_GENERAL, GNC_PREF_TAB_POSITION_LEFT, TRUE);
break;
case GTK_POS_RIGHT:
gnc_prefs_set_bool (GNC_PREFS_GROUP_GENERAL, GNC_PREF_TAB_POSITION_RIGHT, TRUE);
break;
}
}
#ifndef MAC_INTEGRATION
static void
gnc_main_window_cmd_window_raise (GtkAction *action,

View File

@ -111,8 +111,10 @@ struct _GncPeriodSelectPrivate
GtkWidget *date_label;
};
G_DEFINE_TYPE_WITH_PRIVATE(GncPeriodSelect, gnc_period_select, GTK_TYPE_BOX)
#define GNC_PERIOD_SELECT_GET_PRIVATE(o) \
((GncPeriodSelectPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_PERIOD_SELECT))
((GncPeriodSelectPrivate*)gnc_period_select_get_instance_private((GncPeriodSelect*)o))
/************************************************************/
@ -560,8 +562,6 @@ gnc_period_select_class_init (GncPeriodSelectClass *klass)
G_PARAM_READWRITE));
}
G_DEFINE_TYPE_WITH_PRIVATE(GncPeriodSelect, gnc_period_select, GTK_TYPE_BOX)
/** Initialize a new instance of a gnucash accounting period selection
* widget. This function allocates and initializes the object
* private storage space.

View File

@ -106,7 +106,7 @@ typedef struct GncPluginFileHistoryPrivate
#define GNC_PLUGIN_FILE_HISTORY_GET_PRIVATE(o) \
((GncPluginFileHistoryPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_PLUGIN_FILE_HISTORY))
((GncPluginFileHistoryPrivate*)gnc_plugin_file_history_get_instance_private((GncPluginFileHistory*)o))
/************************************************************
* Other Functions *

View File

@ -44,8 +44,10 @@ typedef struct GncPluginManagerPrivate
GHashTable *plugins_table;
} GncPluginManagerPrivate;
G_DEFINE_TYPE_WITH_PRIVATE(GncPluginManager, gnc_plugin_manager, G_TYPE_OBJECT)
#define GNC_PLUGIN_MANAGER_GET_PRIVATE(o) \
((GncPluginManagerPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_PLUGIN_MANAGER))
((GncPluginManagerPrivate*)gnc_plugin_manager_get_instance_private((GncPluginManager*)o))
enum
{
@ -151,8 +153,6 @@ gnc_plugin_manager_get_plugin (GncPluginManager *manager,
return GNC_PLUGIN (g_hash_table_lookup (priv->plugins_table, name));
}
G_DEFINE_TYPE_WITH_PRIVATE(GncPluginManager, gnc_plugin_manager, G_TYPE_OBJECT)
static void
gnc_plugin_manager_class_init (GncPluginManagerClass *klass)
{

View File

@ -69,7 +69,7 @@ typedef struct GncPluginMenuAdditionsPrivate
} GncPluginMenuAdditionsPrivate;
#define GNC_PLUGIN_MENU_ADDITIONS_GET_PRIVATE(o) \
((GncPluginMenuAdditionsPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_PLUGIN_MENU_ADDITIONS))
((GncPluginMenuAdditionsPrivate*)gnc_plugin_menu_additions_get_instance_private((GncPluginMenuAdditions*)o))
/** Per-window private data for this plugin. This plugin is unique in

View File

@ -115,7 +115,7 @@ GNC_DEFINE_TYPE_WITH_CODE(GncPluginPage, gnc_plugin_page, G_TYPE_OBJECT,
G_ADD_PRIVATE(GncPluginPage))
#define GNC_PLUGIN_PAGE_GET_PRIVATE(o) \
((GncPluginPagePrivate*)g_type_instance_get_private ((GTypeInstance*)o, GNC_TYPE_PLUGIN_PAGE))
((GncPluginPagePrivate*)gnc_plugin_page_get_instance_private((GncPluginPage*)o))
/* Create the display widget that corresponds to this plugin. This
* function will be called by the main/embedded window manipulation

View File

@ -65,7 +65,7 @@ GNC_DEFINE_TYPE_WITH_CODE(GncPlugin, gnc_plugin, G_TYPE_OBJECT,
G_ADD_PRIVATE(GncPlugin))
#define GNC_PLUGIN_GET_PRIVATE(o) \
((GncPluginPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_PLUGIN))
((GncPluginPrivate*)gnc_plugin_get_instance_private((GncPlugin*)o))
/** Initialize the class for the new gnucash plugin object. This will
* set up any function pointers that override functions in the parent

View File

@ -52,8 +52,10 @@ struct _GNCQueryViewPrivate
gint component_id;
};
G_DEFINE_TYPE_WITH_PRIVATE(GNCQueryView, gnc_query_view, GTK_TYPE_TREE_VIEW)
#define GNC_QUERY_VIEW_GET_PRIVATE(o) \
((GNCQueryViewPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_QUERY_VIEW))
((GNCQueryViewPrivate*)gnc_query_view_get_instance_private((GNCQueryView*)o))
/** Static Globals ****************************************************/
static GtkTreeViewClass *parent_class = NULL;
@ -185,8 +187,6 @@ gnc_query_view_refresh_handler (GHashTable *changes, gpointer user_data)
gnc_query_view_set_query_sort (qview, TRUE);
}
G_DEFINE_TYPE_WITH_PRIVATE(GNCQueryView, gnc_query_view, GTK_TYPE_TREE_VIEW)
static void
gnc_query_view_init (GNCQueryView *qview)
{

View File

@ -56,7 +56,7 @@ typedef struct GncTreeModelAccountTypesPrivate
} GncTreeModelAccountTypesPrivate;
#define GNC_TREE_MODEL_ACCOUNT_TYPES_GET_PRIVATE(o) \
((GncTreeModelAccountTypesPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_TREE_MODEL_ACCOUNT_TYPES))
((GncTreeModelAccountTypesPrivate*)gnc_tree_model_account_types_get_instance_private((GncTreeModelAccountTypes*)o))
static GObjectClass *parent_class = NULL;

View File

@ -104,8 +104,14 @@ typedef struct GncTreeModelAccountPrivate
} GncTreeModelAccountPrivate;
G_DEFINE_TYPE_WITH_CODE (GncTreeModelAccount,
gnc_tree_model_account, GNC_TYPE_TREE_MODEL,
G_ADD_PRIVATE (GncTreeModelAccount)
G_IMPLEMENT_INTERFACE (GTK_TYPE_TREE_MODEL,
gnc_tree_model_account_tree_model_init))
#define GNC_TREE_MODEL_ACCOUNT_GET_PRIVATE(o) \
((GncTreeModelAccountPrivate*)g_type_instance_get_private ((GTypeInstance*)o, GNC_TYPE_TREE_MODEL_ACCOUNT))
((GncTreeModelAccountPrivate*)gnc_tree_model_account_get_instance_private((GncTreeModelAccount*)o))
/************************************************************/
@ -153,11 +159,6 @@ gnc_tree_model_account_update_color (gpointer gsettings, gchar *key, gpointer us
/** A pointer to the parent class of an account tree model. */
static GObjectClass *parent_class = NULL;
G_DEFINE_TYPE_WITH_CODE (GncTreeModelAccount, gnc_tree_model_account, GNC_TYPE_TREE_MODEL,
G_ADD_PRIVATE (GncTreeModelAccount)
G_IMPLEMENT_INTERFACE (GTK_TYPE_TREE_MODEL,
gnc_tree_model_account_tree_model_init))
static void
gnc_tree_model_account_class_init (GncTreeModelAccountClass *klass)
{

View File

@ -102,7 +102,7 @@ typedef struct GncTreeModelCommodityPrivate
} GncTreeModelCommodityPrivate;
#define GNC_TREE_MODEL_COMMODITY_GET_PRIVATE(o) \
((GncTreeModelCommodityPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_TREE_MODEL_COMMODITY))
((GncTreeModelCommodityPrivate*)gnc_tree_model_commodity_get_instance_private((GncTreeModelCommodity*)o))
/** A pointer to the parent class of a commodity tree model. */
static GObjectClass *parent_class = NULL;

View File

@ -98,8 +98,14 @@ typedef struct GncTreeModelOwnerPrivate
const gchar *negative_color;
} GncTreeModelOwnerPrivate;
G_DEFINE_TYPE_WITH_CODE(GncTreeModelOwner, gnc_tree_model_owner,
GNC_TYPE_TREE_MODEL,
G_ADD_PRIVATE(GncTreeModelOwner)
G_IMPLEMENT_INTERFACE(GTK_TYPE_TREE_MODEL,
gnc_tree_model_owner_tree_model_init))
#define GNC_TREE_MODEL_OWNER_GET_PRIVATE(o) \
((GncTreeModelOwnerPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_TREE_MODEL_OWNER))
((GncTreeModelOwnerPrivate*)gnc_tree_model_owner_get_instance_private((GncTreeModelOwner*)o))
/************************************************************/
@ -146,11 +152,6 @@ gnc_tree_model_owner_class_init (GncTreeModelOwnerClass *klass)
o_class->dispose = gnc_tree_model_owner_dispose;
}
G_DEFINE_TYPE_WITH_CODE(GncTreeModelOwner, gnc_tree_model_owner, GNC_TYPE_TREE_MODEL,
G_ADD_PRIVATE(GncTreeModelOwner)
G_IMPLEMENT_INTERFACE(GTK_TYPE_TREE_MODEL,
gnc_tree_model_owner_tree_model_init))
static void
gnc_tree_model_owner_init (GncTreeModelOwner *model)
{

View File

@ -132,7 +132,7 @@ typedef struct GncTreeModelPricePrivate
} GncTreeModelPricePrivate;
#define GNC_TREE_MODEL_PRICE_GET_PRIVATE(o) \
((GncTreeModelPricePrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_TREE_MODEL_PRICE))
((GncTreeModelPricePrivate*)gnc_tree_model_price_get_instance_private((GncTreeModelPrice*)o))
/** A pointer to the parent class of a price tree model. */
static GObjectClass *parent_class = NULL;

View File

@ -97,7 +97,7 @@ typedef struct GncTreeModelSelectionPrivate
} GncTreeModelSelectionPrivate;
#define GNC_TREE_MODEL_SELECTION_GET_PRIVATE(o) \
((GncTreeModelSelectionPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_TREE_MODEL_SELECTION))
((GncTreeModelSelectionPrivate*)gnc_tree_model_selection_get_instance_private((GncTreeModelSelection*)o))
static GObjectClass *parent_class = NULL;

View File

@ -51,7 +51,7 @@ GNC_DEFINE_TYPE_WITH_CODE(GncTreeModel, gnc_tree_model, G_TYPE_OBJECT,
G_ADD_PRIVATE(GncTreeModel))
#define GNC_TREE_MODEL_GET_PRIVATE(o) \
((GncTreeModelPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_TREE_MODEL))
((GncTreeModelPrivate*)gnc_tree_model_get_instance_private((GncTreeModel*)o))
/************************************************************/

View File

@ -115,7 +115,7 @@ typedef struct GncTreeViewAccountPrivate
} GncTreeViewAccountPrivate;
#define GNC_TREE_VIEW_ACCOUNT_GET_PRIVATE(o) \
((GncTreeViewAccountPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_TREE_VIEW_ACCOUNT))
((GncTreeViewAccountPrivate*)gnc_tree_view_account_get_instance_private((GncTreeViewAccount*)o))
/************************************************************/

View File

@ -58,7 +58,7 @@ typedef struct GncTreeViewCommodityPrivate
} GncTreeViewCommodityPrivate;
#define GNC_TREE_VIEW_COMMODITY_GET_PRIVATE(o) \
((GncTreeViewCommodityPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_TREE_VIEW_COMMODITY))
((GncTreeViewCommodityPrivate*)gnc_tree_view_commodity_get_instance_private(GncTreeViewCommodity*)o))
/************************************************************/

View File

@ -87,7 +87,7 @@ typedef struct GncTreeViewOwnerPrivate
} GncTreeViewOwnerPrivate;
#define GNC_TREE_VIEW_OWNER_GET_PRIVATE(o) \
((GncTreeViewOwnerPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_TREE_VIEW_OWNER))
((GncTreeViewOwnerPrivate*)gnc_tree_view_owner_get_instance_private((GncTreeViewOwner*)o))
/************************************************************/

View File

@ -58,7 +58,7 @@ typedef struct GncTreeViewPricePrivate
} GncTreeViewPricePrivate;
#define GNC_TREE_VIEW_PRICE_GET_PRIVATE(o) \
((GncTreeViewPricePrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_TREE_VIEW_PRICE))
((GncTreeViewPricePrivate*)gnc_tree_view_price_get_instance_private((GncTreeViewPrice*)o))
/************************************************************/

View File

@ -59,7 +59,7 @@ typedef struct GncTreeViewSxListPrivate
} GncTreeViewSxListPrivate;
#define GNC_TREE_VIEW_SX_LIST_GET_PRIVATE(o) \
((GncTreeViewSxListPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_TREE_VIEW_SX_LIST))
((GncTreeViewSxListPrivate*)gnc_tree_view_sx_list_get_instance_private((GncTreeViewSxList*)o))
static GObjectClass *parent_class = NULL;

View File

@ -132,7 +132,7 @@ GNC_DEFINE_TYPE_WITH_CODE(GncTreeView, gnc_tree_view, GTK_TYPE_TREE_VIEW,
G_ADD_PRIVATE(GncTreeView))
#define GNC_TREE_VIEW_GET_PRIVATE(o) \
((GncTreeViewPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_TREE_VIEW))
((GncTreeViewPrivate*)gnc_tree_view_get_instance_private((GncTreeView*)o))
/************************************************************/
@ -1037,13 +1037,17 @@ gnc_tree_view_set_state_section (GncTreeView *view,
gchar *key = keys[idx];
if (g_strcmp0 (key, STATE_KEY_SORT_COLUMN) == 0)
{
gnc_tree_view_set_sort_column (view,
g_key_file_get_string (state_file, priv->state_section, key, NULL));
gchar *name = g_key_file_get_string (state_file, priv->state_section,
key, NULL);
gnc_tree_view_set_sort_column (view, name);
g_free (name);
}
else if (g_strcmp0 (key, STATE_KEY_SORT_ORDER) == 0)
{
gnc_tree_view_set_sort_order (view,
g_key_file_get_string (state_file, priv->state_section, key, NULL));
gchar *name = g_key_file_get_string (state_file, priv->state_section,
key, NULL);
gnc_tree_view_set_sort_order (view, name);
g_free (name);
}
else if (g_strcmp0 (key, STATE_KEY_COLUMN_ORDER) == 0)
{

View File

@ -64,6 +64,8 @@
#define HL_COMMODITY "tool-commodity"
#define HL_FIND_TRANSACTIONS "tool-find"
#define HL_FIN_CALC "tool-calc"
#define HL_PRICE_DB "tool-price"
#define HL_PRICE_EDIT "tool-price-manual"
#define HL_GLOBPREFS "set-prefs"
#define HL_PRINTCHECK "print-check"
#define HL_RECNWIN "acct-reconcile"

View File

@ -53,7 +53,7 @@ struct _GNCSearchParamPrivate
};
#define GNC_SEARCH_PARAM_GET_PRIVATE(o) \
((GNCSearchParamPrivate*)g_type_instance_get_private ((GTypeInstance*)o, GNC_TYPE_SEARCH_PARAM))
((GNCSearchParamPrivate*)gnc_search_param_get_instance_private ((GNCSearchParam*)o))
typedef struct _GNCSearchParamSimplePrivate GNCSearchParamSimplePrivate;
@ -67,7 +67,7 @@ struct _GNCSearchParamSimplePrivate
};
#define GNC_SEARCH_PARAM_SIMPLE_GET_PRIVATE(o) \
((GNCSearchParamSimplePrivate*)g_type_instance_get_private ((GTypeInstance*)o, GNC_TYPE_SEARCH_PARAM_SIMPLE))
((GNCSearchParamSimplePrivate*)gnc_search_param_simple_get_instance_private ((GNCSearchParamSimple*)o))
typedef struct _GNCSearchParamCompoundPrivate GNCSearchParamCompoundPrivate;
@ -80,7 +80,7 @@ struct _GNCSearchParamCompoundPrivate
};
#define GNC_SEARCH_PARAM_COMPOUND_GET_PRIVATE(o) \
((GNCSearchParamCompoundPrivate*)g_type_instance_get_private ((GTypeInstance*)o, GNC_TYPE_SEARCH_PARAM_COMPOUND))
((GNCSearchParamCompoundPrivate*)gnc_search_param_compound_get_instance_private ((GNCSearchParamCompound*)o))
static GObjectClass *parent_gobject_class;
static GNCSearchParamClass *parent_search_param_class;

View File

@ -213,44 +213,25 @@ static void gnc_ui_to_customer (CustomerWindow *cw, GncCustomer *cust)
if (cw->dialog_type == NEW_CUSTOMER)
qof_event_gen(QOF_INSTANCE(cust), QOF_EVENT_ADD, NULL);
gncCustomerSetID (cust, gtk_editable_get_chars
(GTK_EDITABLE (cw->id_entry), 0, -1));
gncCustomerSetName (cust, gtk_editable_get_chars
(GTK_EDITABLE (cw->company_entry), 0, -1));
gncCustomerSetID (cust, gtk_entry_get_text (GTK_ENTRY (cw->id_entry)));
gncCustomerSetName (cust, gtk_entry_get_text (GTK_ENTRY (cw->company_entry)));
gncAddressSetName (addr, gtk_editable_get_chars
(GTK_EDITABLE (cw->name_entry), 0, -1));
gncAddressSetAddr1 (addr, gtk_editable_get_chars
(GTK_EDITABLE (cw->addr1_entry), 0, -1));
gncAddressSetAddr2 (addr, gtk_editable_get_chars
(GTK_EDITABLE (cw->addr2_entry), 0, -1));
gncAddressSetAddr3 (addr, gtk_editable_get_chars
(GTK_EDITABLE (cw->addr3_entry), 0, -1));
gncAddressSetAddr4 (addr, gtk_editable_get_chars
(GTK_EDITABLE (cw->addr4_entry), 0, -1));
gncAddressSetPhone (addr, gtk_editable_get_chars
(GTK_EDITABLE (cw->phone_entry), 0, -1));
gncAddressSetFax (addr, gtk_editable_get_chars
(GTK_EDITABLE (cw->fax_entry), 0, -1));
gncAddressSetEmail (addr, gtk_editable_get_chars
(GTK_EDITABLE (cw->email_entry), 0, -1));
gncAddressSetName (shipaddr, gtk_editable_get_chars
(GTK_EDITABLE (cw->shipname_entry), 0, -1));
gncAddressSetAddr1 (shipaddr, gtk_editable_get_chars
(GTK_EDITABLE (cw->shipaddr1_entry), 0, -1));
gncAddressSetAddr2 (shipaddr, gtk_editable_get_chars
(GTK_EDITABLE (cw->shipaddr2_entry), 0, -1));
gncAddressSetAddr3 (shipaddr, gtk_editable_get_chars
(GTK_EDITABLE (cw->shipaddr3_entry), 0, -1));
gncAddressSetAddr4 (shipaddr, gtk_editable_get_chars
(GTK_EDITABLE (cw->shipaddr4_entry), 0, -1));
gncAddressSetPhone (shipaddr, gtk_editable_get_chars
(GTK_EDITABLE (cw->shipphone_entry), 0, -1));
gncAddressSetFax (shipaddr, gtk_editable_get_chars
(GTK_EDITABLE (cw->shipfax_entry), 0, -1));
gncAddressSetEmail (shipaddr, gtk_editable_get_chars
(GTK_EDITABLE (cw->shipemail_entry), 0, -1));
gncAddressSetName (addr, gtk_entry_get_text (GTK_ENTRY (cw->name_entry)));
gncAddressSetAddr1 (addr, gtk_entry_get_text (GTK_ENTRY (cw->addr1_entry)));
gncAddressSetAddr2 (addr, gtk_entry_get_text (GTK_ENTRY (cw->addr2_entry)));
gncAddressSetAddr3 (addr, gtk_entry_get_text (GTK_ENTRY (cw->addr3_entry)));
gncAddressSetAddr4 (addr, gtk_entry_get_text (GTK_ENTRY (cw->addr4_entry)));
gncAddressSetPhone (addr, gtk_entry_get_text (GTK_ENTRY (cw->phone_entry)));
gncAddressSetFax (addr, gtk_entry_get_text (GTK_ENTRY (cw->fax_entry)));
gncAddressSetEmail (addr, gtk_entry_get_text (GTK_ENTRY (cw->email_entry)));
gncAddressSetName (shipaddr, gtk_entry_get_text (GTK_ENTRY (cw->shipname_entry)));
gncAddressSetAddr1 (shipaddr, gtk_entry_get_text (GTK_ENTRY (cw->shipaddr1_entry)));
gncAddressSetAddr2 (shipaddr, gtk_entry_get_text (GTK_ENTRY (cw->shipaddr2_entry)));
gncAddressSetAddr3 (shipaddr, gtk_entry_get_text (GTK_ENTRY (cw->shipaddr3_entry)));
gncAddressSetAddr4 (shipaddr, gtk_entry_get_text (GTK_ENTRY (cw->shipaddr4_entry)));
gncAddressSetPhone (shipaddr, gtk_entry_get_text (GTK_ENTRY (cw->shipphone_entry)));
gncAddressSetFax (shipaddr, gtk_entry_get_text (GTK_ENTRY (cw->shipfax_entry)));
gncAddressSetEmail (shipaddr, gtk_entry_get_text (GTK_ENTRY (cw->shipemail_entry)));
gncCustomerSetActive (cust, gtk_toggle_button_get_active
(GTK_TOGGLE_BUTTON (cw->active_check)));

View File

@ -109,12 +109,12 @@ gnc_doclink_open_uri (GtkWindow *parent, const gchar *uri)
/* =================================================================== */
static void
location_ok_cb (GtkEditable *editable, gpointer user_data)
location_ok_cb (GtkEntry *entry, gpointer user_data)
{
GtkWidget *ok_button = user_data;
gboolean have_scheme = FALSE;
gchar *text = gtk_editable_get_chars (editable, 0, -1);
GtkWidget *warning_hbox = g_object_get_data (G_OBJECT(editable), "whbox");
const gchar *text = gtk_entry_get_text (entry);
GtkWidget *warning_hbox = g_object_get_data (G_OBJECT(entry), "whbox");
if (text && *text)
{
@ -126,7 +126,6 @@ location_ok_cb (GtkEditable *editable, gpointer user_data)
}
gtk_widget_set_visible (warning_hbox, !have_scheme);
gtk_widget_set_sensitive (ok_button, have_scheme);
g_free (text);
}
static void
@ -216,7 +215,7 @@ uri_type_selected_cb (GtkToggleButton *button, GtkWidget *widget)
{
if (g_strcmp0 (gtk_buildable_get_name (
GTK_BUILDABLE(parent_hbox)), "location_hbox") == 0)
location_ok_cb (GTK_EDITABLE(widget), ok_button);
location_ok_cb (GTK_ENTRY (widget), ok_button);
else
file_ok_cb (GTK_BUTTON(widget), ok_button);

View File

@ -129,32 +129,20 @@ static void gnc_ui_to_employee (EmployeeWindow *ew, GncEmployee *employee)
if (ew->dialog_type == NEW_EMPLOYEE)
qof_event_gen(QOF_INSTANCE(employee), QOF_EVENT_ADD, NULL);
gncEmployeeSetID (employee, gtk_editable_get_chars
(GTK_EDITABLE (ew->id_entry), 0, -1));
gncEmployeeSetUsername (employee, gtk_editable_get_chars
(GTK_EDITABLE (ew->username_entry), 0, -1));
gncAddressSetName (addr, gtk_editable_get_chars
(GTK_EDITABLE (ew->name_entry), 0, -1));
gncAddressSetAddr1 (addr, gtk_editable_get_chars
(GTK_EDITABLE (ew->addr1_entry), 0, -1));
gncAddressSetAddr2 (addr, gtk_editable_get_chars
(GTK_EDITABLE (ew->addr2_entry), 0, -1));
gncAddressSetAddr3 (addr, gtk_editable_get_chars
(GTK_EDITABLE (ew->addr3_entry), 0, -1));
gncAddressSetAddr4 (addr, gtk_editable_get_chars
(GTK_EDITABLE (ew->addr4_entry), 0, -1));
gncAddressSetPhone (addr, gtk_editable_get_chars
(GTK_EDITABLE (ew->phone_entry), 0, -1));
gncAddressSetFax (addr, gtk_editable_get_chars
(GTK_EDITABLE (ew->fax_entry), 0, -1));
gncAddressSetEmail (addr, gtk_editable_get_chars
(GTK_EDITABLE (ew->email_entry), 0, -1));
gncEmployeeSetID (employee, gtk_entry_get_text (GTK_ENTRY (ew->id_entry)));
gncEmployeeSetUsername (employee, gtk_entry_get_text (GTK_ENTRY (ew->username_entry)));
gncAddressSetName (addr, gtk_entry_get_text (GTK_ENTRY (ew->name_entry)));
gncAddressSetAddr1 (addr, gtk_entry_get_text (GTK_ENTRY (ew->addr1_entry)));
gncAddressSetAddr2 (addr, gtk_entry_get_text (GTK_ENTRY (ew->addr2_entry)));
gncAddressSetAddr3 (addr, gtk_entry_get_text (GTK_ENTRY (ew->addr3_entry)));
gncAddressSetAddr4 (addr, gtk_entry_get_text (GTK_ENTRY (ew->addr4_entry)));
gncAddressSetPhone (addr, gtk_entry_get_text (GTK_ENTRY (ew->phone_entry)));
gncAddressSetFax (addr, gtk_entry_get_text (GTK_ENTRY (ew->fax_entry)));
gncAddressSetEmail (addr, gtk_entry_get_text (GTK_ENTRY (ew->email_entry)));
gncEmployeeSetActive (employee, gtk_toggle_button_get_active
(GTK_TOGGLE_BUTTON (ew->active_check)));
gncEmployeeSetLanguage (employee, gtk_editable_get_chars
(GTK_EDITABLE (ew->language_entry), 0, -1));
gncEmployeeSetLanguage (employee, gtk_entry_get_text (GTK_ENTRY (ew->language_entry)));
/* Parse and set the workday and rate amounts */
gncEmployeeSetWorkday (employee, gnc_amount_edit_get_amount

View File

@ -399,10 +399,8 @@ static void gnc_ui_to_invoice (InvoiceWindow *iw, GncInvoice *invoice)
/* Only set these values for NEW/MOD INVOICE types */
if (iw->dialog_type != EDIT_INVOICE)
{
gncInvoiceSetID (invoice, gtk_editable_get_chars
(GTK_EDITABLE (iw->id_entry), 0, -1));
gncInvoiceSetBillingID (invoice, gtk_editable_get_chars
(GTK_EDITABLE (iw->billing_id_entry), 0, -1));
gncInvoiceSetID (invoice, gtk_entry_get_text (GTK_ENTRY (iw->id_entry)));
gncInvoiceSetBillingID (invoice, gtk_entry_get_text (GTK_ENTRY (iw->billing_id_entry)));
gncInvoiceSetTerms (invoice, iw->terms);
gncInvoiceSetDateOpened (invoice, time);

View File

@ -105,12 +105,9 @@ static void gnc_ui_to_job (JobWindow *jw, GncJob *job)
qof_event_gen(QOF_INSTANCE(job), QOF_EVENT_ADD, NULL);
gncJobSetID (job, gtk_editable_get_chars (GTK_EDITABLE (jw->id_entry),
0, -1));
gncJobSetName (job, gtk_editable_get_chars (GTK_EDITABLE (jw->name_entry),
0, -1));
gncJobSetReference (job, gtk_editable_get_chars
(GTK_EDITABLE (jw->desc_entry), 0, -1));
gncJobSetID (job, gtk_entry_get_text (GTK_ENTRY (jw->id_entry)));
gncJobSetName (job, gtk_entry_get_text (GTK_ENTRY (jw->name_entry)));
gncJobSetReference (job, gtk_entry_get_text (GTK_ENTRY (jw->desc_entry)));
gncJobSetRate (job, gnc_amount_edit_get_amount
(GNC_AMOUNT_EDIT (jw->rate_entry)));
gncJobSetActive (job, gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON

View File

@ -513,7 +513,7 @@ gnc_split_viewer_fill (GNCLotViewer *lv, GtkListStore *store, SplitList *split_l
gnc_commodity *currency;
Transaction *trans = xaccSplitGetParent (split);
time64 date = xaccTransGetDate (trans);
gnc_numeric amnt, valu, gains;
gnc_numeric amnt, value, gains;
/* Do not show gains splits, however do show empty business splits */
if (!is_business_lot && gnc_numeric_zero_p (xaccSplitGetAmount(split))) continue;
@ -541,13 +541,13 @@ gnc_split_viewer_fill (GNCLotViewer *lv, GtkListStore *store, SplitList *split_l
* For non-business accounts which are part of a lot,
* invert the sign on the first. */
currency = xaccTransGetCurrency (trans);
valu = xaccSplitGetValue (split);
value = xaccSplitGetValue (split);
if (lv->selected_lot && !is_business_lot && (node != split_list))
valu = gnc_numeric_neg (valu);
xaccSPrintAmount (valbuff, valu,
value = gnc_numeric_neg (value);
xaccSPrintAmount (valbuff, value,
gnc_commodity_print_info (currency, TRUE));
gtk_list_store_set (store, &iter, SPLIT_COL_VALUE, valbuff, -1);
gtk_list_store_set (store, &iter, SPLIT_COL_VALUE_DOUBLE, gnc_numeric_to_double (valu), -1);
gtk_list_store_set (store, &iter, SPLIT_COL_VALUE_DOUBLE, gnc_numeric_to_double (value), -1);
/* Gains. Blank if none. */
gains = xaccSplitGetCapGains (split);

View File

@ -133,16 +133,14 @@ static void gnc_ui_to_order (OrderWindow *ow, GncOrder *order)
gnc_suspend_gui_refresh ();
gncOrderBeginEdit (order);
gncOrderSetID (order, gtk_editable_get_chars
(GTK_EDITABLE (ow->id_entry), 0, -1));
gncOrderSetID (order, gtk_entry_get_text (GTK_ENTRY (ow->id_entry)));
text_buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW(ow->notes_text));
gtk_text_buffer_get_bounds (text_buffer, &start, &end);
text = gtk_text_buffer_get_text (text_buffer, &start, &end, FALSE);
gncOrderSetNotes (order, text);
gncOrderSetReference (order, gtk_editable_get_chars
(GTK_EDITABLE (ow->ref_entry), 0, -1));
gncOrderSetReference (order, gtk_entry_get_text (GTK_ENTRY (ow->ref_entry)));
tt = gnc_date_edit_get_date (GNC_DATE_EDIT (ow->opened_date));
gncOrderSetDateOpened (order, tt);

View File

@ -62,6 +62,7 @@ static QofLogModule log_module = GNC_MOD_GUI;
void gnc_prices_dialog_destroy_cb (GtkWidget *object, gpointer data);
void gnc_prices_dialog_close_cb (GtkDialog *dialog, gpointer data);
void gnc_prices_dialog_help_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);
@ -134,6 +135,15 @@ gnc_prices_dialog_close_cb (GtkDialog *dialog, gpointer data)
}
void
gnc_prices_dialog_help_cb (GtkDialog *dialog, gpointer data)
{
PricesDialog *pdb_dialog = data;
gnc_gnome_help (GTK_WINDOW (pdb_dialog->window), HF_HELP, HL_PRICE_DB);
}
void
gnc_prices_dialog_edit_clicked (GtkWidget *widget, gpointer data)
{

View File

@ -71,6 +71,7 @@ typedef struct
GtkWidget * type_combobox;
GtkWidget * price_edit;
GtkWidget * help_button;
GtkWidget * cancel_button;
GtkWidget * apply_button;
GtkWidget * ok_button;
@ -371,6 +372,10 @@ pedit_dialog_response_cb (GtkDialog *dialog, gint response, gpointer data)
gnc_price_unref (pedit_dialog->price);
pedit_dialog->price = new_price;
}
else if (response == GTK_RESPONSE_HELP)
{
gnc_gnome_help (GTK_WINDOW (pedit_dialog->dialog), HF_HELP, HL_PRICE_EDIT);
}
else
{
gnc_save_window_size(GNC_PREFS_GROUP, GTK_WINDOW(pedit_dialog->dialog));
@ -544,6 +549,9 @@ gnc_price_pedit_dialog_create (GtkWidget *parent,
g_signal_connect (G_OBJECT (w), "changed",
G_CALLBACK (pedit_data_changed_cb), pedit_dialog);
w = GTK_WIDGET(gtk_builder_get_object (builder, "pd_help_button"));
pedit_dialog->help_button = w;
w = GTK_WIDGET(gtk_builder_get_object (builder, "pd_cancel_button"));
pedit_dialog->cancel_button = w;

View File

@ -229,9 +229,7 @@ gnc_style_sheet_new (StyleSheetDialog * 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));
/* put in the list of style sheet type names */
for (; !scm_is_null (templates); templates = SCM_CDR(templates))

View File

@ -264,7 +264,7 @@ editor_ok_button_clicked_cb (GtkButton *b, GncSxEditorDialog *sxed)
static gboolean
gnc_sxed_check_name_changed (GncSxEditorDialog *sxed)
{
char *name = gtk_editable_get_chars (GTK_EDITABLE (sxed->nameEntry), 0, -1);
const char *name = gtk_entry_get_text (GTK_ENTRY (sxed->nameEntry));
if (strlen (name) == 0)
return TRUE;
@ -669,13 +669,18 @@ gnc_sxed_split_calculate_formula (GncSxEditorDialog *sxed, Split *s,
key, &str,
NULL);
if (str == NULL || strlen (str) == 0)
{
if (str)
g_free (str);
return TRUE; /* No formula no foul */
}
if (gnc_sx_parse_vars_from_formula (str, vars, &tmp) < 0)
{
gchar *err = g_strdup_printf (_("Couldn't parse %s for split \"%s\"."),
key, xaccSplitGetMemo (s));
gnc_error_dialog (GTK_WINDOW (sxed->dialog), "%s", err);
g_free (err);
g_free (str);
return FALSE;
}
@ -685,6 +690,7 @@ gnc_sxed_split_calculate_formula (GncSxEditorDialog *sxed, Split *s,
else
tcds->debitSum = gnc_numeric_add (tcds->debitSum, tmp, 100,
GNC_DENOM_AUTO | GNC_HOW_DENOM_LCD);
g_free (str);
return TRUE;
}

View File

@ -1105,6 +1105,7 @@ close_handler (gpointer user_data)
gnc_save_window_size (GNC_PREFS_GROUP_STARTUP, GTK_WINDOW(app_dialog->dialog));
gtk_widget_destroy (app_dialog->dialog);
g_free (app_dialog);
}
static void

View File

@ -146,27 +146,17 @@ static void gnc_ui_to_vendor (VendorWindow *vw, GncVendor *vendor)
if (vw->dialog_type == NEW_VENDOR)
qof_event_gen(QOF_INSTANCE(vendor), QOF_EVENT_ADD, NULL);
gncVendorSetID (vendor, gtk_editable_get_chars
(GTK_EDITABLE (vw->id_entry), 0, -1));
gncVendorSetName (vendor, gtk_editable_get_chars
(GTK_EDITABLE (vw->company_entry), 0, -1));
gncVendorSetID (vendor, gtk_entry_get_text (GTK_ENTRY (vw->id_entry)));
gncVendorSetName (vendor, gtk_entry_get_text (GTK_ENTRY (vw->company_entry)));
gncAddressSetName (addr, gtk_editable_get_chars
(GTK_EDITABLE (vw->name_entry), 0, -1));
gncAddressSetAddr1 (addr, gtk_editable_get_chars
(GTK_EDITABLE (vw->addr1_entry), 0, -1));
gncAddressSetAddr2 (addr, gtk_editable_get_chars
(GTK_EDITABLE (vw->addr2_entry), 0, -1));
gncAddressSetAddr3 (addr, gtk_editable_get_chars
(GTK_EDITABLE (vw->addr3_entry), 0, -1));
gncAddressSetAddr4 (addr, gtk_editable_get_chars
(GTK_EDITABLE (vw->addr4_entry), 0, -1));
gncAddressSetPhone (addr, gtk_editable_get_chars
(GTK_EDITABLE (vw->phone_entry), 0, -1));
gncAddressSetFax (addr, gtk_editable_get_chars
(GTK_EDITABLE (vw->fax_entry), 0, -1));
gncAddressSetEmail (addr, gtk_editable_get_chars
(GTK_EDITABLE (vw->email_entry), 0, -1));
gncAddressSetName (addr, gtk_entry_get_text (GTK_ENTRY (vw->name_entry)));
gncAddressSetAddr1 (addr, gtk_entry_get_text (GTK_ENTRY (vw->addr1_entry)));
gncAddressSetAddr2 (addr, gtk_entry_get_text (GTK_ENTRY (vw->addr2_entry)));
gncAddressSetAddr3 (addr, gtk_entry_get_text (GTK_ENTRY (vw->addr3_entry)));
gncAddressSetAddr4 (addr, gtk_entry_get_text (GTK_ENTRY (vw->addr4_entry)));
gncAddressSetPhone (addr, gtk_entry_get_text (GTK_ENTRY (vw->phone_entry)));
gncAddressSetFax (addr, gtk_entry_get_text (GTK_ENTRY (vw->fax_entry)));
gncAddressSetEmail (addr, gtk_entry_get_text (GTK_ENTRY (vw->email_entry)));
gncVendorSetActive (vendor, gtk_toggle_button_get_active
(GTK_TOGGLE_BUTTON (vw->active_check)));

View File

@ -176,7 +176,7 @@ struct GncBudgetViewPrivate
G_DEFINE_TYPE_WITH_PRIVATE(GncBudgetView, gnc_budget_view, GTK_TYPE_BOX)
#define GNC_BUDGET_VIEW_GET_PRIVATE(o) \
((GncBudgetViewPrivate*)g_type_instance_get_private ((GTypeInstance*)o, GNC_TYPE_BUDGET_VIEW))
((GncBudgetViewPrivate*)gnc_budget_view_get_instance_private((GncBudgetView*)o))
/** \brief Create new gnc budget view.

View File

@ -74,7 +74,7 @@ typedef struct GncPluginAccountTreePrivate
G_DEFINE_TYPE_WITH_PRIVATE(GncPluginAccountTree, gnc_plugin_account_tree, GNC_TYPE_PLUGIN)
#define GNC_PLUGIN_ACCOUNT_TREE_GET_PRIVATE(o) \
((GncPluginAccountTreePrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_PLUGIN_ACCOUNT_TREE))
((GncPluginAccountTreePrivate*)gnc_plugin_account_tree_get_instance_private((GncPluginAccountTree*)o))
/** A pointer to the parent class of a plugin page. */
static GObjectClass *parent_class = NULL;

View File

@ -277,7 +277,7 @@ typedef struct GncPluginBasicCommandsPrivate
} GncPluginBasicCommandsPrivate;
#define GNC_PLUGIN_BASIC_COMMANDS_GET_PRIVATE(o) \
((GncPluginBasicCommandsPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_PLUGIN_BASIC_COMMANDS))
((GncPluginBasicCommandsPrivate*)gnc_plugin_basic_commands_get_instance_private((GncPluginBasicCommands*)o))
/** A pointer to the parent class of a plugin page. */
static GObjectClass *parent_class = NULL;

View File

@ -102,7 +102,7 @@ typedef struct GncPluginBudgetPrivate
} GncPluginBudgetPrivate;
#define GNC_PLUGIN_BUDGET_GET_PRIVATE(o) \
((GncPluginBudgetPrivate*)g_type_instance_get_private ((GTypeInstance*)o, GNC_TYPE_PLUGIN_BUDGET))
((GncPluginBudgetPrivate*)gnc_plugin_budget_get_instance_private((GncPluginBudget*)o))
static GObjectClass *parent_class = NULL;

View File

@ -348,7 +348,7 @@ typedef struct GncPluginBusinessPrivate
} GncPluginBusinessPrivate;
#define GNC_PLUGIN_BUSINESS_GET_PRIVATE(o) \
((GncPluginBusinessPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_PLUGIN_BUSINESS))
((GncPluginBusinessPrivate*)gnc_plugin_business_get_instance_private((GncPluginBusiness*)o))
static GObjectClass *parent_class = NULL;

View File

@ -115,7 +115,7 @@ typedef struct GncPluginPageAccountTreePrivate
} GncPluginPageAccountTreePrivate;
#define GNC_PLUGIN_PAGE_ACCOUNT_TREE_GET_PRIVATE(o) \
((GncPluginPageAccountTreePrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_PLUGIN_PAGE_ACCOUNT_TREE))
((GncPluginPageAccountTreePrivate*)gnc_plugin_page_account_tree_get_instance_private((GncPluginPageAccountTree*)o))
static GObjectClass *parent_class = NULL;
@ -327,6 +327,15 @@ static const gchar *actions_requiring_account_rw[] =
NULL
};
/** Actions that require the selected account to have subaccounts
* before they are enabled, and the book is in read-write mode. */
static const gchar *actions_requiring_subaccounts_rw[] =
{
"EditRenumberSubaccountsAction",
"EditCascadeAccountAction",
NULL
};
/** Actions that require an account to be selected before they are
* enabled. Those actions can be selected even if the book is in readonly mode. */
static const gchar *actions_requiring_account_always[] =
@ -344,7 +353,6 @@ static const gchar* readonly_inactive_actions[] =
"FileAddAccountHierarchyAssistantAction",
"EditEditAccountAction",
"EditDeleteAccountAction",
"EditRenumberSubaccountsAction",
"ActionsTransferAction",
"ActionsReconcileAction",
"ActionsAutoClearAction",
@ -835,12 +843,24 @@ gnc_plugin_page_account_tree_destroy_widget (GncPluginPage *plugin_page)
static void update_inactive_actions(GncPluginPage *plugin_page)
{
GncPluginPageAccountTreePrivate *priv;
GtkActionGroup *action_group;
gboolean is_sensitive = !qof_book_is_readonly(gnc_get_current_book());
Account *account = NULL;
gboolean allow_write = !qof_book_is_readonly(gnc_get_current_book());
gboolean has_account = FALSE;
gboolean subaccounts = FALSE;
// We are readonly - so we have to switch particular actions to inactive.
g_return_if_fail(plugin_page);
g_return_if_fail(GNC_IS_PLUGIN_PAGE(plugin_page));
g_return_if_fail (plugin_page && GNC_IS_PLUGIN_PAGE(plugin_page));
priv = GNC_PLUGIN_PAGE_ACCOUNT_TREE_GET_PRIVATE (plugin_page);
if (gtk_tree_view_get_selection (priv->tree_view))
{
account = gnc_tree_view_account_get_selected_account (GNC_TREE_VIEW_ACCOUNT(priv->tree_view));
has_account = (account != NULL);
subaccounts = (account && gnc_account_n_children (account) != 0);
/* Check here for placeholder accounts, etc. */
}
/* Get the action group */
action_group = gnc_plugin_page_get_action_group(plugin_page);
@ -848,7 +868,14 @@ static void update_inactive_actions(GncPluginPage *plugin_page)
/* Set the action's sensitivity */
gnc_plugin_update_actions (action_group, readonly_inactive_actions,
"sensitive", is_sensitive);
"sensitive", allow_write);
gnc_plugin_update_actions (action_group, actions_requiring_account_rw,
"sensitive", allow_write && has_account);
gnc_plugin_update_actions (action_group, actions_requiring_account_always,
"sensitive", has_account);
gnc_plugin_update_actions (action_group, actions_requiring_subaccounts_rw,
"sensitive", allow_write && subaccounts);
g_signal_emit (plugin_page, plugin_page_signals[ACCOUNT_SELECTED], 0, account);
}
/**
@ -1040,52 +1067,10 @@ gnc_plugin_page_account_tree_double_click_cb (GtkTreeView *treeview,
static void
gnc_plugin_page_account_tree_selection_changed_cb (GtkTreeSelection *selection,
GncPluginPageAccountTree *page)
GncPluginPageAccountTree *page)
{
GtkActionGroup *action_group;
GtkAction *action;
GtkTreeView *view;
Account *account = NULL;
gboolean sensitive;
gboolean subaccounts;
gboolean is_readwrite = !qof_book_is_readonly(gnc_get_current_book());
g_return_if_fail(GNC_IS_PLUGIN_PAGE_ACCOUNT_TREE(page));
if (!selection)
{
sensitive = FALSE;
subaccounts = FALSE;
}
else
{
g_return_if_fail(GTK_IS_TREE_SELECTION(selection));
view = gtk_tree_selection_get_tree_view (selection);
account = gnc_tree_view_account_get_selected_account (GNC_TREE_VIEW_ACCOUNT(view));
sensitive = (account != NULL);
subaccounts = account && (gnc_account_n_children(account) != 0);
/* Check here for placeholder accounts, etc. */
}
action_group = gnc_plugin_page_get_action_group(GNC_PLUGIN_PAGE(page));
gnc_plugin_update_actions (action_group, actions_requiring_account_rw,
"sensitive", is_readwrite && sensitive);
gnc_plugin_update_actions (action_group, actions_requiring_account_always,
"sensitive", sensitive);
g_signal_emit (page, plugin_page_signals[ACCOUNT_SELECTED], 0, account);
action = gtk_action_group_get_action (action_group, "EditRenumberSubaccountsAction");
g_object_set (G_OBJECT(action), "sensitive",
is_readwrite && sensitive && subaccounts, NULL);
action = gtk_action_group_get_action (action_group, "EditCascadeAccountAction");
g_object_set (G_OBJECT(action), "sensitive", subaccounts, NULL);
gnc_plugin_update_actions (action_group, actions_requiring_account_rw,
"sensitive", is_readwrite && sensitive);
gnc_plugin_update_actions (action_group, actions_requiring_account_always,
"sensitive", sensitive);
GncPluginPage *plugin_page = GNC_PLUGIN_PAGE(page);
update_inactive_actions (plugin_page);
}

View File

@ -282,7 +282,7 @@ typedef struct GncPluginPageBudgetPrivate
G_DEFINE_TYPE_WITH_PRIVATE(GncPluginPageBudget, gnc_plugin_page_budget, GNC_TYPE_PLUGIN_PAGE)
#define GNC_PLUGIN_PAGE_BUDGET_GET_PRIVATE(o) \
((GncPluginPageBudgetPrivate*)g_type_instance_get_private ((GTypeInstance*)o, GNC_TYPE_PLUGIN_PAGE_BUDGET))
((GncPluginPageBudgetPrivate*)gnc_plugin_page_budget_get_instance_private((GncPluginPageBudget*)o))
static GObjectClass *parent_class = NULL;

View File

@ -478,7 +478,7 @@ typedef struct GncPluginPageInvoicePrivate
G_DEFINE_TYPE_WITH_PRIVATE(GncPluginPageInvoice, gnc_plugin_page_invoice, GNC_TYPE_PLUGIN_PAGE)
#define GNC_PLUGIN_PAGE_INVOICE_GET_PRIVATE(o) \
((GncPluginPageInvoicePrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_PLUGIN_PAGE_INVOICE))
((GncPluginPageInvoicePrivate*)gnc_plugin_page_invoice_get_instance_private((GncPluginPageInvoice*)o))
static GObjectClass *parent_class = NULL;

View File

@ -87,8 +87,10 @@ typedef struct GncPluginPageOwnerTreePrivate
OwnerFilterDialog fd;
} GncPluginPageOwnerTreePrivate;
G_DEFINE_TYPE_WITH_PRIVATE(GncPluginPageOwnerTree, gnc_plugin_page_owner_tree, GNC_TYPE_PLUGIN_PAGE)
#define GNC_PLUGIN_PAGE_OWNER_TREE_GET_PRIVATE(o) \
((GncPluginPageOwnerTreePrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_PLUGIN_PAGE_OWNER_TREE))
((GncPluginPageOwnerTreePrivate*)gnc_plugin_page_owner_tree_get_instance_private((GncPluginPageOwnerTree*)o))
static GObjectClass *parent_class = NULL;
@ -397,8 +399,6 @@ gnc_plugin_page_owner_focus_widget (GncPluginPage *owner_plugin_page)
return FALSE;
}
G_DEFINE_TYPE_WITH_PRIVATE(GncPluginPageOwnerTree, gnc_plugin_page_owner_tree, GNC_TYPE_PLUGIN_PAGE)
static void
gnc_plugin_page_owner_tree_class_init (GncPluginPageOwnerTreeClass *klass)
{

View File

@ -736,7 +736,7 @@ G_DEFINE_TYPE_WITH_PRIVATE (GncPluginPageRegister, gnc_plugin_page_register,
GNC_TYPE_PLUGIN_PAGE)
#define GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(o) \
((GncPluginPageRegisterPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_PLUGIN_PAGE_REGISTER))
((GncPluginPageRegisterPrivate*)gnc_plugin_page_register_get_instance_private((GncPluginPageRegister*)o))
static GObjectClass* parent_class = NULL;
@ -2710,7 +2710,6 @@ static void
gnc_ppr_update_status_query (GncPluginPageRegister* page)
{
GncPluginPageRegisterPrivate* priv;
GSList* param_list;
Query* query;
SplitRegister* reg;
@ -2734,9 +2733,9 @@ gnc_ppr_update_status_query (GncPluginPageRegister* page)
reg = gnc_ledger_display_get_split_register (priv->ledger);
/* Remove the old status match */
param_list = qof_query_build_param_list (SPLIT_RECONCILE, NULL);
if (param_list && (reg->type != SEARCH_LEDGER))
if (reg->type != SEARCH_LEDGER)
{
GSList *param_list = qof_query_build_param_list (SPLIT_RECONCILE, NULL);
qof_query_purge_terms (query, param_list);
g_slist_free (param_list);
}
@ -2774,7 +2773,6 @@ static void
gnc_ppr_update_date_query (GncPluginPageRegister* page)
{
GncPluginPageRegisterPrivate* priv;
GSList* param_list;
Query* query;
SplitRegister* reg;
@ -2799,9 +2797,10 @@ gnc_ppr_update_date_query (GncPluginPageRegister* page)
reg = gnc_ledger_display_get_split_register (priv->ledger);
/* Delete any existing old date spec. */
param_list = qof_query_build_param_list (SPLIT_TRANS, TRANS_DATE_POSTED, NULL);
if (param_list && (reg->type != SEARCH_LEDGER))
if (reg->type != SEARCH_LEDGER)
{
GSList *param_list = qof_query_build_param_list (SPLIT_TRANS,
TRANS_DATE_POSTED, NULL);
qof_query_purge_terms (query, param_list);
g_slist_free (param_list);
}

View File

@ -140,7 +140,7 @@ typedef struct GncPluginPageReportPrivate
G_DEFINE_TYPE_WITH_PRIVATE(GncPluginPageReport, gnc_plugin_page_report, GNC_TYPE_PLUGIN_PAGE)
#define GNC_PLUGIN_PAGE_REPORT_GET_PRIVATE(o) \
((GncPluginPageReportPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_PLUGIN_PAGE_REPORT))
((GncPluginPageReportPrivate*)gnc_plugin_page_report_get_instance_private((GncPluginPageReport*)o))
static void gnc_plugin_page_report_class_init( GncPluginPageReportClass *klass );
static void gnc_plugin_page_report_init( GncPluginPageReport *plugin_page );

View File

@ -96,8 +96,10 @@ typedef struct GncPluginPageSxListPrivate
} GncPluginPageSxListPrivate;
G_DEFINE_TYPE_WITH_PRIVATE(GncPluginPageSxList, gnc_plugin_page_sx_list, GNC_TYPE_PLUGIN_PAGE)
#define GNC_PLUGIN_PAGE_SX_LIST_GET_PRIVATE(o) \
((GncPluginPageSxListPrivate*)g_type_instance_get_private ((GTypeInstance*)o, GNC_TYPE_PLUGIN_PAGE_SX_LIST))
((GncPluginPageSxListPrivate*)gnc_plugin_page_sx_list_get_instance_private((GncPluginPageSxList*)o))
static GObjectClass *parent_class = NULL;
@ -185,8 +187,6 @@ gnc_plugin_page_sx_list_focus_widget (GncPluginPage *sx_plugin_page)
return FALSE;
}
G_DEFINE_TYPE_WITH_PRIVATE(GncPluginPageSxList, gnc_plugin_page_sx_list, GNC_TYPE_PLUGIN_PAGE)
static void
gnc_plugin_page_sx_list_class_init (GncPluginPageSxListClass *klass)
{

View File

@ -65,7 +65,7 @@ typedef struct GncPluginRegisterPrivate
G_DEFINE_TYPE_WITH_PRIVATE(GncPluginRegister, gnc_plugin_register, GNC_TYPE_PLUGIN)
#define GNC_PLUGIN_REGISTER_GET_PRIVATE(o) \
((GncPluginRegisterPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_PLUGIN_REGISTER))
((GncPluginRegisterPrivate*)gnc_plugin_register_get_instance_private((GncPluginRegister*)o))
static GObjectClass *parent_class = NULL;
static QofLogModule log_module = GNC_MOD_GUI;

View File

@ -744,9 +744,8 @@ gsr_redraw_all_cb (GnucashRegister *g_reg, gpointer data)
gtk_widget_set_tooltip_text (GTK_WIDGET(gsr->filter_label), gsr->filter_text);
if (old_tt_text)
g_free (old_tt_text);
}
g_free (old_tt_text);
}
if (gsr->shares_label == NULL && gsr->value_label == NULL)

View File

@ -60,7 +60,7 @@ typedef struct _GNCSearchOwnerPrivate
G_DEFINE_TYPE_WITH_PRIVATE(GNCSearchOwner, gnc_search_owner, GNC_TYPE_SEARCH_CORE_TYPE);
#define _PRIVATE(o) \
((GNCSearchOwnerPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_SEARCH_OWNER))
((GNCSearchOwnerPrivate*)gnc_search_owner_get_instance_private((GNCSearchOwner*)o))
static GNCSearchCoreTypeClass *parent_class;

View File

@ -2,27 +2,11 @@
<!-- Generated with glade 3.38.2 -->
<interface>
<requires lib="gtk+" version="3.22"/>
<object class="GtkListStore" id="currency_liststore">
<columns>
<!-- column-name item -->
<column type="gchararray"/>
</columns>
<data>
<row>
<col id="0" translatable="yes">Dummy</col>
</row>
</data>
</object>
<object class="GtkListStore" id="date_format_liststore">
<columns>
<!-- column-name item -->
<column type="gchararray"/>
</columns>
<data>
<row>
<col id="0" translatable="yes">Dummy</col>
</row>
</data>
</object>
<object class="GtkAssistant" id="qif_import_assistant">
<property name="can-focus">False</property>

View File

@ -14,22 +14,12 @@
<!-- column-name item -->
<column type="gchararray"/>
</columns>
<data>
<row>
<col id="0" translatable="yes">Dummy commodity Line</col>
</row>
</data>
</object>
<object class="GtkListStore" id="liststore2">
<columns>
<!-- column-name item -->
<column type="gchararray"/>
</columns>
<data>
<row>
<col id="0" translatable="yes">Dummy namespace Line</col>
</row>
</data>
</object>
<object class="GtkDialog" id="security_dialog">
<property name="can-focus">False</property>
@ -302,11 +292,11 @@
<object class="GtkComboBox" id="namespace_cbwe">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="has-tooltip">True</property>
<property name="tooltip-markup" translatable="yes">Select a category for the commodity or enter a new one. One might use investment categories like STOCKS and BONDS or exchange names like NASDAQ and LSE.</property>
<property name="model">liststore2</property>
<property name="has-entry">True</property>
<property name="entry-text-column">0</property>
<property name="has-tooltip">True</property>
<property name="tooltip-markup" translatable="yes">Select a category for the commodity or enter a new one. One might use investment categories like STOCKS and BONDS or exchange names like NASDAQ and LSE.</property>
<signal name="changed" handler="gnc_ui_commodity_changed_cb" swapped="no"/>
<child internal-child="entry">
<object class="GtkEntry" id="combobox-entry5">
@ -492,7 +482,7 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="halign">end</property>
<property name="label" translatable="yes">_Type</property>
<property name="label" translatable="yes">Nam_espace</property>
<property name="use-underline">True</property>
<property name="justify">center</property>
<property name="mnemonic-widget">namespace_cbwe</property>
@ -774,7 +764,7 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="halign">end</property>
<property name="label" translatable="yes">_Type</property>
<property name="label" translatable="yes">Nam_espace</property>
<property name="use-underline">True</property>
<property name="justify">center</property>
<property name="mnemonic-widget">ss_namespace_cbwe</property>

View File

@ -866,6 +866,151 @@
<action-widget response="-7">matcher_help_close</action-widget>
</action-widgets>
</object>
<object class="GtkDialog" id="transaction_edit_dialog">
<property name="can-focus">False</property>
<property name="title" translatable="yes">Edit imported transaction details</property>
<property name="default-width">320</property>
<property name="type-hint">dialog</property>
<child internal-child="vbox">
<object class="GtkBox">
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">2</property>
<child internal-child="action_area">
<object class="GtkButtonBox">
<property name="can-focus">False</property>
<property name="layout-style">end</property>
<child>
<object class="GtkButton" id="button1">
<property name="label" translatable="yes">_Cancel</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<property name="use-underline">True</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="button2">
<property name="label" translatable="yes">_OK</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<property name="use-underline">True</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<!-- n-columns=2 n-rows=3 -->
<object class="GtkGrid">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="row-spacing">3</property>
<property name="column-spacing">6</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="halign">end</property>
<property name="label" translatable="yes">_Description</property>
<property name="use-underline">True</property>
<property name="mnemonic-widget">desc_entry</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="halign">end</property>
<property name="label" translatable="yes">_Notes</property>
<property name="use-underline">True</property>
<property name="mnemonic-widget">notes_entry</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="halign">end</property>
<property name="label" translatable="yes">_Memo</property>
<property name="use-underline">True</property>
<property name="mnemonic-widget">memo_entry</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="desc_entry">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="notes_entry">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="memo_entry">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
<action-widgets>
<action-widget response="-6">button1</action-widget>
<action-widget response="-5">button2</action-widget>
</action-widgets>
</object>
<object class="GtkBox" id="transaction_matcher_content">
<property name="visible">True</property>
<property name="can-focus">False</property>

View File

@ -30,22 +30,12 @@
<!-- column-name item -->
<column type="gchararray"/>
</columns>
<data>
<row>
<col id="0" translatable="yes">Dummy commodity Line</col>
</row>
</data>
</object>
<object class="GtkListStore" id="liststore3">
<columns>
<!-- column-name item -->
<column type="gchararray"/>
</columns>
<data>
<row>
<col id="0" translatable="yes">Dummy namespace Line</col>
</row>
</data>
</object>
<object class="GtkDialog" id="price_dialog">
<property name="can-focus">False</property>
@ -65,6 +55,22 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="layout-style">end</property>
<child>
<object class="GtkButton" id="pd_help_button">
<property name="label" translatable="yes">_Help</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="can-default">True</property>
<property name="receives-default">False</property>
<property name="use-underline">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
<property name="secondary">True</property>
</packing>
</child>
<child>
<object class="GtkButton" id="pd_cancel_button">
<property name="label" translatable="yes">_Cancel</property>
@ -77,7 +83,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
<property name="position">1</property>
</packing>
</child>
<child>
@ -91,7 +97,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
<property name="position">2</property>
</packing>
</child>
<child>
@ -107,7 +113,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">2</property>
<property name="position">3</property>
</packing>
</child>
</object>
@ -129,7 +135,7 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="halign">end</property>
<property name="label" translatable="yes">_Namespace</property>
<property name="label" translatable="yes">Nam_espace</property>
<property name="use-underline">True</property>
<property name="justify">center</property>
<property name="mnemonic-widget">namespace_cbwe</property>
@ -344,6 +350,7 @@
</object>
</child>
<action-widgets>
<action-widget response="-11">pd_help_button</action-widget>
<action-widget response="-6">pd_cancel_button</action-widget>
<action-widget response="-10">pd_apply_button</action-widget>
<action-widget response="-5">pd_ok_button</action-widget>
@ -792,13 +799,15 @@ These prices were added so that there's always a "nearest in time" price for eve
<property name="default-width">800</property>
<property name="default-height">400</property>
<child>
<object class="GtkBox" id="vbox11">
<!-- n-columns=2 n-rows=2 -->
<object class="GtkGrid">
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
<object class="GtkBox" id="hbox1">
<object class="GtkBox" id="vbox11">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkScrolledWindow" id="price_list_window">
<property name="visible">True</property>
@ -808,6 +817,120 @@ These prices were added so that there's always a "nearest in time" price for eve
<property name="border-width">3</property>
<property name="shadow-type">in</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="margin-bottom">6</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkButtonBox" id="vbuttonbox1">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="border-width">5</property>
<property name="orientation">vertical</property>
<property name="spacing">12</property>
<property name="layout-style">start</property>
<child>
<object class="GtkButton" id="add_button">
<property name="label" translatable="yes">_Add</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="can-default">True</property>
<property name="receives-default">False</property>
<property name="tooltip-text" translatable="yes">Add a new price.</property>
<property name="use-underline">True</property>
<signal name="clicked" handler="gnc_prices_dialog_add_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="remove_button">
<property name="label" translatable="yes">_Remove</property>
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can-focus">True</property>
<property name="can-default">True</property>
<property name="receives-default">False</property>
<property name="tooltip-text" translatable="yes">Remove the current price.</property>
<property name="use-underline">True</property>
<signal name="clicked" handler="gnc_prices_dialog_remove_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="edit_button">
<property name="label" translatable="yes">_Edit</property>
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can-focus">True</property>
<property name="can-default">True</property>
<property name="receives-default">False</property>
<property name="tooltip-text" translatable="yes">Edit the current price.</property>
<property name="use-underline">True</property>
<signal name="clicked" handler="gnc_prices_dialog_edit_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkButton" id="remove_old_button">
<property name="label" translatable="yes">Remove _Old</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="can-default">True</property>
<property name="receives-default">False</property>
<property name="tooltip-text" translatable="yes">Remove prices older than a user-entered date.</property>
<property name="use-underline">True</property>
<signal name="clicked" handler="gnc_prices_dialog_remove_old_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">3</property>
</packing>
</child>
<child>
<object class="GtkButton" id="get_quotes_button">
<property name="label" translatable="yes">_Get Quotes</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="can-default">True</property>
<property name="receives-default">False</property>
<property name="tooltip-text" translatable="yes">Get new online quotes for stock accounts.</property>
<property name="use-underline">True</property>
<signal name="clicked" handler="gnc_prices_dialog_get_quotes_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">4</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
@ -815,157 +938,72 @@ These prices were added so that there's always a "nearest in time" price for eve
</packing>
</child>
<child>
<object class="GtkBox">
<object class="GtkButtonBox" id="vbuttonbox2">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="margin-bottom">12</property>
<property name="valign">end</property>
<property name="border-width">5</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<property name="layout-style">start</property>
<child>
<object class="GtkButtonBox" id="vbuttonbox1">
<object class="GtkButton" id="close_button">
<property name="label" translatable="yes">_Close</property>
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="border-width">5</property>
<property name="orientation">vertical</property>
<property name="spacing">12</property>
<property name="layout-style">start</property>
<child>
<object class="GtkButton" id="add_button">
<property name="label" translatable="yes">_Add</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="can-default">True</property>
<property name="receives-default">False</property>
<property name="tooltip-text" translatable="yes">Add a new price.</property>
<property name="use-underline">True</property>
<signal name="clicked" handler="gnc_prices_dialog_add_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="remove_button">
<property name="label" translatable="yes">_Remove</property>
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can-focus">True</property>
<property name="can-default">True</property>
<property name="receives-default">False</property>
<property name="tooltip-text" translatable="yes">Remove the current price.</property>
<property name="use-underline">True</property>
<signal name="clicked" handler="gnc_prices_dialog_remove_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="edit_button">
<property name="label" translatable="yes">_Edit</property>
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can-focus">True</property>
<property name="can-default">True</property>
<property name="receives-default">False</property>
<property name="tooltip-text" translatable="yes">Edit the current price.</property>
<property name="use-underline">True</property>
<signal name="clicked" handler="gnc_prices_dialog_edit_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkButton" id="remove_old_button">
<property name="label" translatable="yes">Remove _Old</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="can-default">True</property>
<property name="receives-default">False</property>
<property name="tooltip-text" translatable="yes">Remove prices older than a user-entered date.</property>
<property name="use-underline">True</property>
<signal name="clicked" handler="gnc_prices_dialog_remove_old_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">3</property>
</packing>
</child>
<child>
<object class="GtkButton" id="get_quotes_button">
<property name="label" translatable="yes">_Get Quotes</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="can-default">True</property>
<property name="receives-default">False</property>
<property name="tooltip-text" translatable="yes">Get new online quotes for stock accounts.</property>
<property name="use-underline">True</property>
<signal name="clicked" handler="gnc_prices_dialog_get_quotes_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">4</property>
</packing>
</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="vbuttonbox2">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="valign">end</property>
<property name="border-width">5</property>
<property name="orientation">vertical</property>
<property name="layout-style">start</property>
<child>
<object class="GtkButton" id="close_button">
<property name="label" translatable="yes">_Close</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="can-default">True</property>
<property name="receives-default">False</property>
<property name="valign">start</property>
<property name="use-underline">True</property>
<signal name="clicked" handler="gnc_prices_dialog_close_cb" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<property name="can-focus">True</property>
<property name="can-default">True</property>
<property name="receives-default">False</property>
<property name="valign">start</property>
<property name="use-underline">True</property>
<signal name="clicked" handler="gnc_prices_dialog_close_cb" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">2</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
<property name="left-attach">1</property>
<property name="top-attach">0</property>
<property name="height">2</property>
</packing>
</child>
<child>
<object class="GtkButtonBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="valign">end</property>
<property name="layout-style">start</property>
<child>
<object class="GtkButton" id="help_button">
<property name="label" translatable="yes">_Help</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="can-default">True</property>
<property name="receives-default">False</property>
<property name="margin-bottom">9</property>
<property name="use-underline">True</property>
<signal name="clicked" handler="gnc_prices_dialog_help_cb" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">1</property>
</packing>
</child>
</object>

View File

@ -697,11 +697,6 @@
<!-- column-name item -->
<column type="gchararray"/>
</columns>
<data>
<row>
<col id="0" translatable="yes">Dummy</col>
</row>
</data>
</object>
<object class="GtkDialog" id="new_style_sheet_dialog">
<property name="can-focus">False</property>

View File

@ -73,7 +73,7 @@ static void gnc_html_dispose( GObject* obj );
static void gnc_html_finalize( GObject* obj );
/*
#define GNC_HTML_GET_PRIVATE(o) \
((GncHtmlPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_HTML))
((GncHtmlPrivate*)gnc_html_get_instance_private((GncHtml*)o))
*/
#define GNC_HTML_GET_PRIVATE(o) (GNC_HTML(o)->priv)

View File

@ -755,7 +755,7 @@ save_kvp_acc_cb(gpointer key, gpointer value, gpointer user_data)
const gchar *ab_bankcode, *gnc_bankcode;
#ifdef AQBANKING6
gchar *ab_online_id;
const gchar *gnc_online_id;
gchar *gnc_online_id;
#endif
g_return_if_fail(ab_acc && gnc_acc);
@ -796,6 +796,7 @@ save_kvp_acc_cb(gpointer key, gpointer value, gpointer user_data)
if (ab_online_id && (!gnc_online_id || (strcmp(ab_online_id, gnc_online_id) != 0)))
gnc_import_set_acc_online_id(gnc_acc, ab_online_id);
g_free(ab_online_id);
g_free (gnc_online_id);
#endif
}

File diff suppressed because it is too large Load Diff

View File

@ -94,12 +94,12 @@ typedef struct _GncABImExContextImport GncABImExContextImport;
* Initialize the gwenhywfar library by calling GWEN_Init() and setting up
* gwenhywfar logging.
*/
void gnc_GWEN_Init(void);
void gnc_GWEN_Init (void);
/**
* Finalize the gwenhywfar library.
*/
void gnc_GWEN_Fini(void);
void gnc_GWEN_Fini (void);
/**
* If there is a cached AB_BANKING object, return it initialized. Otherwise,
@ -108,7 +108,7 @@ void gnc_GWEN_Fini(void);
*
* @return The AB_BANKING object
*/
AB_BANKING *gnc_AB_BANKING_new(void);
AB_BANKING *gnc_AB_BANKING_new (void);
/**
* Delete the AB_BANKING @a api. If this is also the one that was cached by
@ -116,7 +116,7 @@ AB_BANKING *gnc_AB_BANKING_new(void);
*
* @param api AB_BANKING or NULL for the cached AB_BANKING object
*/
void gnc_AB_BANKING_delete(AB_BANKING *api);
void gnc_AB_BANKING_delete (AB_BANKING *api);
/**
* Finish the AB_BANKING @a api. If this is also the one that was cached by
@ -127,7 +127,7 @@ void gnc_AB_BANKING_delete(AB_BANKING *api);
* @param api AB_BANKING object
* @return Zero on success
*/
gint gnc_AB_BANKING_fini(AB_BANKING *api);
gint gnc_AB_BANKING_fini (AB_BANKING *api);
/**
* Get the corresponding AqBanking account to the GnuCash account @a gnc_acc.
@ -138,7 +138,7 @@ gint gnc_AB_BANKING_fini(AB_BANKING *api);
* @param gnc_acc The GnuCash account to query for GNC_AB_ACCOUNT_SPEC reference data
* @return The GNC_AB_ACCOUNT_SPEC found or NULL otherwise
*/
GNC_AB_ACCOUNT_SPEC *gnc_ab_get_ab_account(const AB_BANKING *api, Account *gnc_acc);
GNC_AB_ACCOUNT_SPEC *gnc_ab_get_ab_account (const AB_BANKING *api, Account *gnc_acc);
/**
* Print the value of @a value with two decimal places and @a value's
@ -147,7 +147,7 @@ GNC_AB_ACCOUNT_SPEC *gnc_ab_get_ab_account(const AB_BANKING *api, Account *gnc_a
* @param value AB_VALUE or NULL
* @return A newly allocated string
*/
gchar *gnc_AB_VALUE_to_readable_string(const AB_VALUE *value);
gchar *gnc_AB_VALUE_to_readable_string (const AB_VALUE *value);
/**
* Return the job as string.
@ -155,7 +155,7 @@ gchar *gnc_AB_VALUE_to_readable_string(const AB_VALUE *value);
* @param value GNC_AB_JOB or NULL
* @return A newly allocated string
*/
gchar *gnc_AB_JOB_to_readable_string(const GNC_AB_JOB *job);
gchar *gnc_AB_JOB_to_readable_string (const GNC_AB_JOB *job);
/**
* Return the job_id as string.
@ -163,7 +163,7 @@ gchar *gnc_AB_JOB_to_readable_string(const GNC_AB_JOB *job);
* @param job_id
* @return A newly allocated string
*/
gchar *gnc_AB_JOB_ID_to_string(gulong job_id);
gchar *gnc_AB_JOB_ID_to_string (gulong job_id);
/**
* Retrieve the merged "remote name" fields from a transaction. The returned
@ -173,7 +173,7 @@ gchar *gnc_AB_JOB_ID_to_string(gulong job_id);
* @param ab_trans AqBanking transaction
* @return A newly allocated string or NULL otherwise
*/
gchar *gnc_ab_get_remote_name(const AB_TRANSACTION *ab_trans);
gchar *gnc_ab_get_remote_name (const AB_TRANSACTION *ab_trans);
/**
* Retrieve the merged purpose fields from a transaction. The returned string
@ -183,7 +183,7 @@ gchar *gnc_ab_get_remote_name(const AB_TRANSACTION *ab_trans);
* @param ab_trans AqBanking transaction
* @return A newly allocated string, may be ""
*/
gchar *gnc_ab_get_purpose(const AB_TRANSACTION *ab_trans, gboolean is_ofx);
gchar *gnc_ab_get_purpose (const AB_TRANSACTION *ab_trans, gboolean is_ofx);
/**
* Create the appropriate description field for a GnuCash Transaction by the
@ -193,7 +193,7 @@ gchar *gnc_ab_get_purpose(const AB_TRANSACTION *ab_trans, gboolean is_ofx);
* @param ab_trans AqBanking transaction
* @return A newly allocated string, may be ""
*/
gchar *gnc_ab_description_to_gnc(const AB_TRANSACTION *ab_trans, gboolean is_ofx);
gchar *gnc_ab_description_to_gnc (const AB_TRANSACTION *ab_trans, gboolean is_ofx);
/**
* Create the appropriate memo field for a GnuCash Split by the information
@ -203,7 +203,7 @@ gchar *gnc_ab_description_to_gnc(const AB_TRANSACTION *ab_trans, gboolean is_ofx
* @param ab_trans AqBanking transaction
* @return A newly allocated string, may be ""
*/
gchar *gnc_ab_memo_to_gnc(const AB_TRANSACTION *ab_trans);
gchar *gnc_ab_memo_to_gnc (const AB_TRANSACTION *ab_trans);
/**
* Create an unbalanced and dirty GnuCash transaction with a split to @a gnc_acc
@ -213,7 +213,7 @@ gchar *gnc_ab_memo_to_gnc(const AB_TRANSACTION *ab_trans);
* @param gnc_acc Account of to use for the split
* @return A dirty GnuCash transaction or NULL otherwise
*/
Transaction *gnc_ab_trans_to_gnc(const AB_TRANSACTION *ab_trans, Account *gnc_acc);
Transaction *gnc_ab_trans_to_gnc (const AB_TRANSACTION *ab_trans, Account *gnc_acc);
/**
* Import balances and transactions found in a AB_IMEXPORTER_CONTEXT into
@ -239,9 +239,11 @@ Transaction *gnc_ab_trans_to_gnc(const AB_TRANSACTION *ab_trans, Account *gnc_ac
* gnc_ab_ieci_get_job_list() must be called and the result freed with
* AB_Job_List2_FreeAll()
*/
GncABImExContextImport *gnc_ab_import_context(
AB_IMEXPORTER_CONTEXT *context, guint awaiting, gboolean execute_txns,
AB_BANKING *api, GtkWidget *parent);
GncABImExContextImport *gnc_ab_import_context (AB_IMEXPORTER_CONTEXT *context,
guint awaiting,
gboolean execute_txns,
AB_BANKING *api,
GtkWidget *parent);
/**
* Extract awaiting from @a data.
@ -250,7 +252,7 @@ GncABImExContextImport *gnc_ab_import_context(
* @return The initial awaiting bitmask plus IGNORE_* for unexpected and then
* ignored items, and FOUND_* for non-empty items
*/
guint gnc_ab_ieci_get_found(GncABImExContextImport *ieci);
guint gnc_ab_ieci_get_found (GncABImExContextImport *ieci);
/**
* Extract the job list from @a data.
@ -258,7 +260,7 @@ guint gnc_ab_ieci_get_found(GncABImExContextImport *ieci);
* @param ieci The return value of gnc_ab_import_context()
* @return The list of jobs, freeable with AB_Job_List2_FreeAll()
*/
GNC_AB_JOB_LIST2 *gnc_ab_ieci_get_job_list(GncABImExContextImport *ieci);
GNC_AB_JOB_LIST2 *gnc_ab_ieci_get_job_list (GncABImExContextImport *ieci);
/**
* Run the generic transaction matcher dialog.
@ -266,7 +268,7 @@ GNC_AB_JOB_LIST2 *gnc_ab_ieci_get_job_list(GncABImExContextImport *ieci);
* @param ieci The return value of gnc_ab_import_context()
* @return The return value of gnc_gen_trans_list_run().
*/
gboolean gnc_ab_ieci_run_matcher(GncABImExContextImport *ieci);
gboolean gnc_ab_ieci_run_matcher (GncABImExContextImport *ieci);
/**
@ -274,7 +276,7 @@ gboolean gnc_ab_ieci_run_matcher(GncABImExContextImport *ieci);
*
* @return a GWEN_DB containing all permanently accepted SSL certificates (hashed).
*/
GWEN_DB_NODE *gnc_ab_get_permanent_certs(void);
GWEN_DB_NODE *gnc_ab_get_permanent_certs (void);
/**
* Creates an online ID from bank code and account number.
@ -285,7 +287,7 @@ GWEN_DB_NODE *gnc_ab_get_permanent_certs(void);
* @param accountnumber Account number
* @return an online ID
*/
gchar* gnc_ab_create_online_id(const gchar *bankcode, const gchar *accountnumber);
gchar* gnc_ab_create_online_id (const gchar *bankcode, const gchar *accountnumber);
#if (AQBANKING_VERSION_INT >= 60400)
@ -296,7 +298,7 @@ gchar* gnc_ab_create_online_id(const gchar *bankcode, const gchar *accountnumber
* @return A GList of newly allocated GncABTransTempls
*/
GList*
gnc_ab_trans_templ_list_new_from_ref_accounts(GNC_AB_ACCOUNT_SPEC *ab_acc);
gnc_ab_trans_templ_list_new_from_ref_accounts (GNC_AB_ACCOUNT_SPEC *ab_acc);
#endif
G_END_DECLS

View File

@ -393,6 +393,7 @@ add_price (gchar *so_far, Split *split, gboolean t_void, CsvExportInfo *info)
conv = csv_txn_test_field_string (info, string_amount);
result = g_strconcat (so_far, conv, info->end_sep, EOLSTR, NULL);
g_free (conv);
g_free (so_far);
return result;
}
@ -649,6 +650,7 @@ void csv_transactions_export (CsvExportInfo *info)
DEBUG("Account being processed is : %s", xaccAccountGetName (acc));
account_splits (info, acc, fh);
}
g_list_free (info->csva.account_list);
}
else
account_splits (info, info->account, fh);

View File

@ -74,7 +74,7 @@ typedef struct GncPluginCsvExportPrivate
G_DEFINE_TYPE_WITH_PRIVATE(GncPluginCsvExport, gnc_plugin_csv_export, GNC_TYPE_PLUGIN)
#define GNC_PLUGIN_CSV_EXPORT_GET_PRIVATE(o) \
((GncPluginCsvExportPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_PLUGIN_CSV_EXPORT))
((GncPluginCsvExportPrivate*)gnc_plugin_csv_export_get_instance_private((GncPluginCsvExport*)o))
static GObjectClass *parent_class = NULL;

View File

@ -72,7 +72,7 @@ typedef struct GncPluginCsvImportPrivate
G_DEFINE_TYPE_WITH_PRIVATE(GncPluginCsvImport, gnc_plugin_csv_import, GNC_TYPE_PLUGIN)
#define GNC_PLUGIN_CSV_IMPORT_GET_PRIVATE(o) \
((GncPluginCsvImportPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_PLUGIN_CSV_IMPORT))
((GncPluginCsvImportPrivate*)gnc_plugin_csv_import_get_instance_private((GncPluginCsvImport*)o))
static GObjectClass *parent_class = NULL;

View File

@ -101,11 +101,15 @@ static AccountPickerDialog* gnc_import_new_account_picker(void)
static gpointer test_acct_online_id_match(Account *acct, gpointer data)
{
AccountOnlineMatch *match = (AccountOnlineMatch*)data;
const char *acct_online_id = gnc_import_get_acc_online_id(acct);
char *acct_online_id = gnc_import_get_acc_online_id(acct);
int acct_len, match_len;
if (acct_online_id == NULL || match->online_id == NULL)
{
if (acct_online_id)
g_free (acct_online_id);
return NULL;
}
acct_len = strlen(acct_online_id);
match_len = strlen(match->online_id);
@ -118,7 +122,10 @@ static gpointer test_acct_online_id_match(Account *acct, gpointer data)
if (strncmp (acct_online_id, match->online_id, acct_len) == 0)
{
if (strncmp(acct_online_id, match->online_id, match_len) == 0)
{
g_free (acct_online_id);
return (gpointer *) acct;
}
if (match->partial_match == NULL)
{
match->partial_match = acct;
@ -126,7 +133,7 @@ static gpointer test_acct_online_id_match(Account *acct, gpointer data)
}
else
{
const char *partial_online_id =
char *partial_online_id =
gnc_import_get_acc_online_id(match->partial_match);
int partial_len = strlen(partial_online_id);
if (partial_online_id[partial_len - 1] == ' ')
@ -157,9 +164,11 @@ static gpointer test_acct_online_id_match(Account *acct, gpointer data)
g_free (name1);
g_free (name2);
}
g_free (partial_online_id);
}
}
g_free (acct_online_id);
return NULL;
}

View File

@ -1057,8 +1057,10 @@ gnc_import_process_trans_item (GncImportMatchMap *matchmap,
the match will be remembered */
if (gnc_import_split_has_online_id(trans_info->first_split))
{
gnc_import_set_split_online_id(selected_match->split,
gnc_import_get_split_online_id(trans_info->first_split));
char *online_id = gnc_import_get_split_online_id
(trans_info->first_split);
gnc_import_set_split_online_id(selected_match->split, online_id);
g_free (online_id);
}
/* Done editing. */
@ -1112,9 +1114,12 @@ gnc_import_process_trans_item (GncImportMatchMap *matchmap,
/* Copy the online id to the reconciled transaction, so
the match will be remembered */
if (gnc_import_split_has_online_id(trans_info->first_split))
gnc_import_set_split_online_id
(selected_match->split,
gnc_import_get_split_online_id(trans_info->first_split));
{
char *online_id = gnc_import_get_split_online_id
(trans_info->first_split);
gnc_import_set_split_online_id (selected_match->split, online_id);
g_free (online_id);
}
/* Done editing. */
/*DEBUG("CommitEdit selected_match")*/
@ -1152,8 +1157,8 @@ static gint check_trans_online_id(Transaction *trans1, void *user_data)
Account *account;
Split *split1;
Split *split2 = user_data;
const gchar *online_id1;
const gchar *online_id2;
gchar *online_id1, *online_id2;
gint retval;
account = xaccSplitGetAccount(split2);
split1 = xaccTransFindSplitByAccount(trans1, account);
@ -1164,24 +1169,22 @@ static gint check_trans_online_id(Transaction *trans1, void *user_data)
instead of the transactions */
g_assert(split1 != NULL);
if (gnc_import_split_has_online_id(split1))
online_id1 = gnc_import_get_split_online_id(split1);
else
online_id1 = gnc_import_get_trans_online_id(trans1);
online_id1 = gnc_import_get_split_online_id (split1);
if (!online_id1 || !online_id1[0])
{
if (online_id1)
g_free (online_id1);
online_id1 = gnc_import_get_trans_online_id (trans1);
}
online_id2 = gnc_import_get_split_online_id(split2);
if ((online_id1 == NULL) ||
(online_id2 == NULL) ||
(strcmp(online_id1, online_id2) != 0))
{
return 0;
}
else
{
/*printf("test_trans_online_id(): Duplicate found\n");*/
return 1;
}
retval = (!online_id1 || !online_id2 || strcmp (online_id1, online_id2)) ? 0 : 1;
g_free (online_id1);
g_free (online_id2);
return retval;
}
/** Checks whether the given transaction's online_id already exists in
@ -1191,30 +1194,38 @@ gboolean gnc_import_exists_online_id (Transaction *trans, GHashTable* acct_id_ha
gboolean online_id_exists = FALSE;
Account *dest_acct;
Split *source_split;
char *source_online_id;
/* Look for an online_id in the first split */
source_split = xaccTransGetSplit(trans, 0);
g_assert(source_split);
source_online_id = gnc_import_get_split_online_id (source_split);
// No online id, no point in continuing. We'd crash if we tried.
if (!gnc_import_get_split_online_id (source_split))
if (!source_online_id)
return FALSE;
// Create a hash per account of a hash of all split IDs. Then the test below will be fast if
// we have many transactions to import.
// Create a hash per account of a hash of all split IDs. Then the
// test below will be fast if we have many transactions to import.
dest_acct = xaccSplitGetAccount (source_split);
if (!g_hash_table_contains (acct_id_hash, dest_acct))
{
GHashTable* new_hash = g_hash_table_new (g_str_hash, g_str_equal);
GList* split_list = xaccAccountGetSplitList(dest_acct);
GHashTable* new_hash = g_hash_table_new_full
(g_str_hash, g_str_equal, g_free, NULL);
g_hash_table_insert (acct_id_hash, dest_acct, new_hash);
for (;split_list;split_list=split_list->next)
for (GList *n = xaccAccountGetSplitList (dest_acct) ; n; n=n->next)
{
if (gnc_import_split_has_online_id (split_list->data))
g_hash_table_add (new_hash, (void*) gnc_import_get_split_online_id (split_list->data));
if (gnc_import_split_has_online_id (n->data))
{
char *id = gnc_import_get_split_online_id (n->data);
if (!g_hash_table_insert (new_hash, (void*) id, GINT_TO_POINTER (1)))
g_free (id);
}
}
}
online_id_exists = g_hash_table_contains (g_hash_table_lookup (acct_id_hash, dest_acct),
gnc_import_get_split_online_id (source_split));
source_online_id);
/* If it does, abort the process for this transaction, since it is
already in the system. */
@ -1224,6 +1235,7 @@ gboolean gnc_import_exists_online_id (Transaction *trans, GHashTable* acct_id_ha
xaccTransDestroy(trans);
xaccTransCommitEdit(trans);
}
g_free (source_online_id);
return online_id_exists;
}

View File

@ -80,6 +80,17 @@ struct _main_matcher_info
GSList* temp_trans_list; // Temporary list of imported transactions
GHashTable* acct_id_hash; // Hash table, per account, of list of transaction IDs.
GSList* edited_accounts; // List of accounts currently edited.
/* only when editing fields */
gboolean edit_desc;
gboolean edit_notes;
gboolean edit_memo;
GHashTable *desc_hash;
GHashTable *notes_hash;
GHashTable *memo_hash;
GList *new_strings;
};
enum downloaded_cols
@ -90,7 +101,12 @@ enum downloaded_cols
DOWNLOADED_COL_AMOUNT,
DOWNLOADED_COL_AMOUNT_DOUBLE, // used only for sorting
DOWNLOADED_COL_DESCRIPTION,
DOWNLOADED_COL_DESCRIPTION_ORIGINAL,
DOWNLOADED_COL_DESCRIPTION_STYLE,
DOWNLOADED_COL_MEMO,
DOWNLOADED_COL_MEMO_ORIGINAL,
DOWNLOADED_COL_MEMO_STYLE,
DOWNLOADED_COL_NOTES_ORIGINAL,
DOWNLOADED_COL_ACTION_ADD,
DOWNLOADED_COL_ACTION_CLEAR,
DOWNLOADED_COL_ACTION_UPDATE,
@ -111,6 +127,8 @@ enum downloaded_cols
/*static QofLogModule log_module = GNC_MOD_IMPORT;*/
static QofLogModule log_module = G_MOD_IMPORT_MATCHER;
static const gpointer one = GINT_TO_POINTER (1);
void on_matcher_ok_clicked (GtkButton *button, GNCImportMainMatcher *info);
void on_matcher_cancel_clicked (GtkButton *button, gpointer user_data);
gboolean on_matcher_delete_event (GtkWidget *widget, GdkEvent *event, gpointer data);
@ -130,8 +148,7 @@ static void gnc_gen_trans_assign_transfer_account_to_selection_cb (GtkMenuItem *
GNCImportMainMatcher *info);
static void gnc_gen_trans_view_popup_menu (GtkTreeView *treeview,
GdkEvent *event,
GNCImportMainMatcher *info,
gboolean show_edit_actions);
GNCImportMainMatcher *info);
static gboolean gnc_gen_trans_onButtonPressed_cb (GtkTreeView *treeview,
GdkEvent *event,
GNCImportMainMatcher *info);
@ -147,14 +164,6 @@ static gboolean query_tooltip_tree_view_cb (GtkWidget *widget, gint x, gint y,
gpointer user_data);
/* end local prototypes */
static
gboolean delete_hash (gpointer key, gpointer value, gpointer user_data)
{
// Value is a hash table that needs to be destroyed.
g_hash_table_destroy (value);
return TRUE;
}
static void
update_all_balances (GNCImportMainMatcher *info)
{
@ -221,8 +230,14 @@ gnc_gen_trans_list_delete (GNCImportMainMatcher *info)
// We've deferred balance computations on many accounts. Let's do it now that we're done.
update_all_balances (info);
g_hash_table_foreach_remove (info->acct_id_hash, delete_hash, NULL);
info->acct_id_hash = NULL;
gnc_import_PendingMatches_delete (info->pending_matches);
g_hash_table_destroy (info->acct_id_hash);
g_hash_table_destroy (info->desc_hash);
g_hash_table_destroy (info->notes_hash);
g_hash_table_destroy (info->memo_hash);
g_list_free_full (info->new_strings, (GDestroyNotify)g_free);
g_free (info);
}
@ -388,8 +403,6 @@ remove_top_matches (GNCImportMainMatcher* gui, GtkTreeModel* model, GList* confl
match_trans = g_list_remove (match_trans, match_trans->data);
gnc_import_TransInfo_set_match_list (trans_info, match_trans);
}
g_list_free (conflicts);
}
static void
@ -433,6 +446,8 @@ resolve_conflicts (GNCImportMainMatcher *info)
valid = gtk_tree_model_iter_next (model, &import_iter);
/* NOTE: The loop is guaranteed to terminate because whenever we go back to the top
* we remove at least 1 match, and there's a finite number of them. */
g_list_free (conflicts);
}
// Refresh all
@ -444,6 +459,47 @@ resolve_conflicts (GNCImportMainMatcher *info)
}
}
static void
load_hash_tables (GNCImportMainMatcher *info)
{
GtkTreeModel *model = gtk_tree_view_get_model (info->view);
GtkTreeIter import_iter;
GList *accounts_list = NULL;
gboolean valid = gtk_tree_model_get_iter_first (model, &import_iter);
while (valid)
{
GNCImportTransInfo *trans_info = get_trans_info (model, &import_iter);
Split *s = gnc_import_TransInfo_get_fsplit (trans_info);
Account *acc = xaccSplitGetAccount (s);
if (!g_list_find (accounts_list, acc))
accounts_list = g_list_prepend (accounts_list, acc);
valid = gtk_tree_model_iter_next (model, &import_iter);
}
for (GList *m = accounts_list; m; m = m->next)
{
for (GList *n = xaccAccountGetSplitList (m->data); n; n = n->next)
{
const Split *s = n->data;
const Transaction *t = xaccSplitGetParent (s);
const gchar *key;
key = xaccTransGetDescription (t);
if (key && *key)
g_hash_table_insert (info->desc_hash, (gpointer)key, one);
key = xaccTransGetNotes (t);
if (key && *key)
g_hash_table_insert (info->notes_hash, (gpointer)key, one);
key = xaccSplitGetMemo (s);
if (key && *key)
g_hash_table_insert (info->memo_hash, (gpointer)key, one);
}
}
g_list_free (accounts_list);
}
void
gnc_gen_trans_list_show_all (GNCImportMainMatcher *info)
{
@ -469,6 +525,7 @@ gnc_gen_trans_list_show_all (GNCImportMainMatcher *info)
xaccAccountGetAppendText(account));
gnc_gen_trans_list_create_matches (info);
load_hash_tables (info);
resolve_conflicts (info);
gtk_widget_show_all (GTK_WIDGET(info->main_widget));
gnc_gen_trans_list_show_accounts_column (info);
@ -885,26 +942,170 @@ gnc_gen_trans_assign_transfer_account_to_selection_cb (GtkMenuItem *menuitem,
LEAVE("");
}
typedef enum
typedef struct
{
DESCRIPTION,
MEMO,
NOTES,
} edit_field;
Split *split;
Transaction *trans;
GtkTreeIter iter;
char *orig_desc, *orig_notes, *orig_memo;
} RowInfo;
static void rowinfo_free (RowInfo* info)
{
g_free (info->orig_desc);
g_free (info->orig_notes);
g_free (info->orig_memo);
g_free (info);
}
static RowInfo * row_get_info (gpointer row, GNCImportMainMatcher *info)
{
GNCImportTransInfo *trans_info;
GtkTreeModel *model = gtk_tree_view_get_model (info->view);
RowInfo *retval = g_new (RowInfo, 1);
gtk_tree_model_get_iter (model, &retval->iter, row);
gtk_tree_model_get (model, &retval->iter,
DOWNLOADED_COL_DATA, &trans_info,
DOWNLOADED_COL_DESCRIPTION_ORIGINAL, &retval->orig_desc,
DOWNLOADED_COL_NOTES_ORIGINAL, &retval->orig_notes,
DOWNLOADED_COL_MEMO_ORIGINAL, &retval->orig_memo,
-1);
retval->trans = gnc_import_TransInfo_get_trans (trans_info);
retval->split = gnc_import_TransInfo_get_fsplit (trans_info);
return retval;
}
enum
{
COMPLETION_LIST_ORIGINAL,
COMPLETION_LIST_NORMALIZED_FOLDED,
NUM_COMPLETION_COLS
};
static void populate_list (gpointer key, gpointer value, GtkListStore *list)
{
GtkTreeIter iter;
const char *original = key;
char *normalized = g_utf8_normalize (original, -1, G_NORMALIZE_ALL);
char *normalized_folded = normalized ? g_utf8_casefold (normalized, -1) : NULL;
gtk_list_store_append (list, &iter);
gtk_list_store_set (list, &iter,
COMPLETION_LIST_ORIGINAL, original,
COMPLETION_LIST_NORMALIZED_FOLDED, normalized_folded,
-1);
g_free (normalized_folded);
g_free (normalized);
}
static gboolean
match_func (GtkEntryCompletion *completion, const char *entry_str,
GtkTreeIter *iter, gpointer user_data)
{
GtkTreeModel *model = user_data;
gchar *existing_str = NULL;
gboolean ret = FALSE;
gtk_tree_model_get (model, iter,
COMPLETION_LIST_NORMALIZED_FOLDED, &existing_str,
-1);
if (existing_str && *existing_str && strstr (existing_str, entry_str))
ret = TRUE;
g_free (existing_str);
return ret;
}
static void
gnc_gen_trans_edit_fields (GtkMenuItem *menuitem, GNCImportMainMatcher *info,
edit_field field)
setup_entry (GtkWidget *entry, gboolean sensitive, GHashTable *hash,
const char *initial)
{
GtkEntryCompletion* completion;
GtkListStore *list;
gtk_entry_set_text (GTK_ENTRY (entry), sensitive ? initial : _("Disabled"));
gtk_widget_set_sensitive (entry, sensitive);
if (!sensitive)
return;
list = gtk_list_store_new (NUM_COMPLETION_COLS, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING);
g_hash_table_foreach (hash, (GHFunc)populate_list, list);
if (!g_hash_table_lookup (hash, (gpointer)initial))
populate_list ((gpointer)initial, NULL, list);
gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (list),
COMPLETION_LIST_ORIGINAL,
GTK_SORT_ASCENDING);
completion = gtk_entry_completion_new ();
gtk_entry_completion_set_model (completion, GTK_TREE_MODEL(list));
gtk_entry_completion_set_text_column (completion, COMPLETION_LIST_ORIGINAL);
gtk_entry_completion_set_match_func (completion,
(GtkEntryCompletionMatchFunc)match_func,
GTK_TREE_MODEL(list), NULL);
gtk_entry_set_completion (GTK_ENTRY (entry), completion);
}
static gboolean
input_new_fields (GNCImportMainMatcher *info, RowInfo *rowinfo,
char **new_desc, char **new_notes, char **new_memo)
{
GtkWidget *desc_entry, *notes_entry, *memo_entry, *label;
GtkWidget *dialog;
GtkBuilder *builder;
gboolean retval = FALSE;
builder = gtk_builder_new ();
gnc_builder_add_from_file (builder, "dialog-import.glade", "transaction_edit_dialog");
dialog = GTK_WIDGET(gtk_builder_get_object (builder, "transaction_edit_dialog"));
desc_entry = GTK_WIDGET(gtk_builder_get_object (builder, "desc_entry"));
memo_entry = GTK_WIDGET(gtk_builder_get_object (builder, "memo_entry"));
notes_entry = GTK_WIDGET(gtk_builder_get_object (builder, "notes_entry"));
setup_entry (desc_entry, info->edit_desc, info->desc_hash, xaccTransGetDescription (rowinfo->trans));
setup_entry (notes_entry, info->edit_notes, info->notes_hash, xaccTransGetNotes (rowinfo->trans));
setup_entry (memo_entry, info->edit_memo, info->memo_hash, xaccSplitGetMemo (rowinfo->split));
gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (info->main_widget));
// run the dialog
gtk_widget_show_all (dialog);
switch (gtk_dialog_run (GTK_DIALOG(dialog)))
{
case GTK_RESPONSE_OK:
*new_desc = g_strdup (gtk_entry_get_text (GTK_ENTRY (desc_entry)));
*new_notes = g_strdup (gtk_entry_get_text (GTK_ENTRY (notes_entry)));
*new_memo = g_strdup (gtk_entry_get_text (GTK_ENTRY (memo_entry)));
retval = TRUE;
break;
default:
break;
}
gtk_widget_destroy (dialog);
g_object_unref (G_OBJECT(builder));
return retval;
}
static inline void
maybe_add_string (GNCImportMainMatcher *info, GHashTable *hash, const char *str)
{
char *new_string;
if (!str || !str[0] || g_hash_table_lookup (info->desc_hash, str))
return;
new_string = g_strdup (str);
info->new_strings = g_list_prepend (info->new_strings, new_string);
g_hash_table_insert (hash, new_string, one);
}
static void
gnc_gen_trans_edit_fields (GtkMenuItem *menuitem, GNCImportMainMatcher *info)
{
GtkTreeView *treeview;
GtkTreeSelection *selection;
GtkTreeModel *model;
GList *selected_rows;
GList *refs = NULL;
GList *selected_rows, *row_info_list;
GtkTreeStore* store;
GNCImportTransInfo *trans_info;
Transaction* trans;
GtkTreeIter iter;
char *new_desc = NULL, *new_notes = NULL, *new_memo = NULL;
g_return_if_fail (info != NULL);
ENTER("assign_transfer_account_to_selection_cb");
@ -921,81 +1122,93 @@ gnc_gen_trans_edit_fields (GtkMenuItem *menuitem, GNCImportMainMatcher *info,
return;
}
if (selected_rows->next)
row_info_list = gnc_g_list_map (selected_rows, (GncGMapFunc) row_get_info, info);
if (input_new_fields (info, row_info_list->data,
&new_desc, &new_notes, &new_memo))
{
LEAVE ("User selected multiple rows, not supported");
return;
}
g_return_if_fail (gtk_tree_model_get_iter (model, &iter,
selected_rows->data));
gtk_tree_model_get (model, &iter, DOWNLOADED_COL_DATA,
&trans_info, -1);
trans = gnc_import_TransInfo_get_trans (trans_info);
switch (field)
{
case DESCRIPTION:
{
char* new_field =
gnc_input_dialog_with_entry(info->main_widget, "",
_("Enter new Description"),
xaccTransGetDescription (trans));
if (!new_field) break;
xaccTransSetDescription (trans, new_field);
gtk_tree_store_set (store, &iter, DOWNLOADED_COL_DESCRIPTION,
new_field, -1);
g_free (new_field);
break;
}
case MEMO:
{
Split *first_split =
gnc_import_TransInfo_get_fsplit (trans_info);
char *new_field =
gnc_input_dialog_with_entry(info->main_widget, "",
_("Enter new Memo"),
xaccSplitGetMemo (first_split));
if (!new_field) break;
xaccSplitSetMemo (first_split, new_field);
gtk_tree_store_set (store, &iter,
DOWNLOADED_COL_MEMO, new_field, -1);
g_free (new_field);
break;
}
case NOTES:
{
char* new_field =
gnc_input_dialog_with_entry(info->main_widget, "",
_("Enter new Notes"),
xaccTransGetNotes (trans));
if (!new_field) break;
xaccTransSetNotes (trans, new_field);
g_free (new_field);
break;
}
for (GList *n = row_info_list; n; n = g_list_next (n))
{
RowInfo *row = n->data;
if (info->edit_desc)
{
gint style = g_strcmp0 (new_desc, row->orig_desc) ?
PANGO_STYLE_ITALIC : PANGO_STYLE_NORMAL;
gtk_tree_store_set (store, &row->iter,
DOWNLOADED_COL_DESCRIPTION, new_desc,
DOWNLOADED_COL_DESCRIPTION_STYLE, style,
-1);
xaccTransSetDescription (row->trans, new_desc);
maybe_add_string (info, info->desc_hash, new_desc);
}
if (info->edit_notes)
{
xaccTransSetNotes (row->trans, new_notes);
maybe_add_string (info, info->notes_hash, new_notes);
}
if (info->edit_memo)
{
gint style = g_strcmp0 (new_memo, row->orig_memo) ?
PANGO_STYLE_ITALIC : PANGO_STYLE_NORMAL;
gtk_tree_store_set (store, &row->iter,
DOWNLOADED_COL_MEMO, new_memo,
DOWNLOADED_COL_MEMO_STYLE, style,
-1);
xaccSplitSetMemo (row->split, new_memo);
maybe_add_string (info, info->memo_hash, new_memo);
}
}
g_free (new_desc);
g_free (new_memo);
g_free (new_notes);
}
g_list_free_full (row_info_list, (GDestroyNotify)rowinfo_free);
g_list_free_full (selected_rows, (GDestroyNotify)gtk_tree_path_free);
LEAVE("");
}
static void
gnc_gen_trans_edit_description_cb (GtkMenuItem *menuitem, GNCImportMainMatcher *info)
gnc_gen_trans_reset_edits_cb (GtkMenuItem *menuitem, GNCImportMainMatcher *info)
{
gnc_gen_trans_edit_fields (menuitem, info, DESCRIPTION);
}
GtkTreeView *treeview;
GtkTreeModel *model;
GtkTreeStore *store;
GtkTreeSelection *selection;
GList *selected_rows, *row_info_list;
static void
gnc_gen_trans_edit_memo_cb (GtkMenuItem *menuitem, GNCImportMainMatcher *info)
{
gnc_gen_trans_edit_fields (menuitem, info, MEMO);
}
g_return_if_fail (info != NULL);
ENTER("gnc_gen_trans_reset_edits_cb");
static void
gnc_gen_trans_edit_notes_cb (GtkMenuItem *menuitem, GNCImportMainMatcher *info)
{
gnc_gen_trans_edit_fields (menuitem, info, NOTES);
treeview = GTK_TREE_VIEW(info->view);
model = gtk_tree_view_get_model (treeview);
store = GTK_TREE_STORE (model);
selection = gtk_tree_view_get_selection (treeview);
selected_rows = gtk_tree_selection_get_selected_rows (selection, &model);
if (!selected_rows)
{
LEAVE ("No selected rows");
return;
}
for (GList *n = selected_rows; n; n = g_list_next (n))
{
RowInfo *rowinfo = row_get_info (n->data, info);
xaccTransSetDescription (rowinfo->trans, rowinfo->orig_desc);
xaccTransSetNotes (rowinfo->trans, rowinfo->orig_notes);
xaccSplitSetMemo (rowinfo->split, rowinfo->orig_memo);
gtk_tree_store_set (store, &rowinfo->iter,
DOWNLOADED_COL_DESCRIPTION, rowinfo->orig_desc,
DOWNLOADED_COL_MEMO, rowinfo->orig_memo,
DOWNLOADED_COL_DESCRIPTION_STYLE, PANGO_STYLE_NORMAL,
DOWNLOADED_COL_MEMO_STYLE, PANGO_STYLE_NORMAL,
-1);
rowinfo_free (rowinfo);
};
g_list_free_full (selected_rows, (GDestroyNotify)gtk_tree_path_free);
LEAVE("");
}
static void
@ -1052,10 +1265,10 @@ gnc_gen_trans_row_changed_cb (GtkTreeSelection *selection,
{
// Unselect rows that should not be selectable
GList* list = gtk_tree_selection_get_selected_rows (selection, &model);
for ( ; list; list=list->next)
for (GList *n = list; n; n = n->next)
{
if (get_action_for_path (list->data, model) != GNCImport_ADD)
gtk_tree_selection_unselect_path (selection, list->data);
if (get_action_for_path (n->data, model) != GNCImport_ADD)
gtk_tree_selection_unselect_path (selection, n->data);
}
g_list_free_full (list, (GDestroyNotify)gtk_tree_path_free);
}
@ -1085,16 +1298,20 @@ gnc_gen_trans_row_changed_cb (GtkTreeSelection *selection,
static void
gnc_gen_trans_view_popup_menu (GtkTreeView *treeview,
GdkEvent *event,
GNCImportMainMatcher *info,
gboolean show_edit_actions)
GNCImportMainMatcher *info)
{
GtkWidget *menu, *menuitem;
GdkEventButton *event_button;
GtkTreeModel *model;
GtkTreeSelection *selection;
GList *selected_rows, *row_info_list;
const char *desc = NULL, *memo = NULL, *notes = NULL;
gboolean has_edits = FALSE;
ENTER ("");
menu = gtk_menu_new();
menuitem = gtk_menu_item_new_with_label (
_("Assign a transfer account to the selection."));
menuitem = gtk_menu_item_new_with_mnemonic (
/* Translators: Menu entry, no full stop */
_("_Assign a transfer account to the selection"));
g_signal_connect (menuitem, "activate",
G_CALLBACK(
gnc_gen_trans_assign_transfer_account_to_selection_cb),
@ -1102,37 +1319,73 @@ gnc_gen_trans_view_popup_menu (GtkTreeView *treeview,
DEBUG("Callback to assign destination account to selection connected");
gtk_menu_shell_append (GTK_MENU_SHELL(menu), menuitem);
if (show_edit_actions)
model = gtk_tree_view_get_model (treeview);
selection = gtk_tree_view_get_selection (treeview);
selected_rows = gtk_tree_selection_get_selected_rows (selection, &model);
row_info_list = gnc_g_list_map (selected_rows, (GncGMapFunc) row_get_info, info);
if (row_info_list) /* should never be NULL. collect from first row. */
{
menuitem = gtk_menu_item_new_with_label (
_("Edit description."));
g_signal_connect (menuitem, "activate",
G_CALLBACK (gnc_gen_trans_edit_description_cb),
info);
DEBUG("Callback to edit description");
gtk_menu_shell_append (GTK_MENU_SHELL(menu), menuitem);
menuitem = gtk_menu_item_new_with_label (
_("Edit memo."));
g_signal_connect (menuitem, "activate",
G_CALLBACK (gnc_gen_trans_edit_memo_cb),
info);
DEBUG("Callback to edit memo");
gtk_menu_shell_append (GTK_MENU_SHELL(menu), menuitem);
menuitem = gtk_menu_item_new_with_label (
_("Edit notes."));
g_signal_connect (menuitem, "activate",
G_CALLBACK (gnc_gen_trans_edit_notes_cb),
info);
DEBUG("Callback to edit notes");
gtk_menu_shell_append (GTK_MENU_SHELL(menu), menuitem);
RowInfo* first_rowinfo = row_info_list->data;
desc = xaccTransGetDescription (first_rowinfo->trans);
notes = xaccTransGetNotes (first_rowinfo->trans);
memo = xaccSplitGetMemo (first_rowinfo->split);
}
/* initialise */
info->edit_desc = TRUE;
info->edit_notes = TRUE;
info->edit_memo = TRUE;
/* determine whether to enable editing fields (if all rows have
same field string) and resetting fields (if any row differs from
imported data) */
for (GList *n = row_info_list; n; n = g_list_next(n))
{
RowInfo *rowinfo = n->data;
if (!has_edits &&
(g_strcmp0 (xaccSplitGetMemo (rowinfo->split), rowinfo->orig_memo) ||
g_strcmp0 (xaccTransGetNotes (rowinfo->trans), rowinfo->orig_notes) ||
g_strcmp0 (xaccTransGetDescription (rowinfo->trans), rowinfo->orig_desc)))
has_edits = TRUE;
if (info->edit_desc && g_strcmp0 (desc, xaccTransGetDescription (rowinfo->trans)))
info->edit_desc = FALSE;
if (info->edit_notes && g_strcmp0 (notes, xaccTransGetNotes (rowinfo->trans)))
info->edit_notes = FALSE;
if (info->edit_memo && g_strcmp0 (memo, xaccSplitGetMemo (rowinfo->split)))
info->edit_memo = FALSE;
/* all flags were switched. no need to scan remaining rows. */
if (has_edits && !info->edit_desc && !info->edit_notes && !info->edit_memo)
break;
}
/* Translators: Menu entry, no full stop */
menuitem = gtk_menu_item_new_with_mnemonic (_("_Edit description, notes, or memo"));
gtk_widget_set_sensitive (menuitem,
info->edit_desc || info->edit_notes || info->edit_memo);
g_signal_connect (menuitem, "activate",
G_CALLBACK (gnc_gen_trans_edit_fields),
info);
gtk_menu_shell_append (GTK_MENU_SHELL(menu), menuitem);
/* Translators: Menu entry, no full stop */
menuitem = gtk_menu_item_new_with_mnemonic (_("_Reset all edits"));
gtk_widget_set_sensitive (menuitem, has_edits);
g_signal_connect (menuitem, "activate",
G_CALLBACK (gnc_gen_trans_reset_edits_cb),
info);
gtk_menu_shell_append (GTK_MENU_SHELL(menu), menuitem);
gtk_menu_attach_to_widget (GTK_MENU (menu), GTK_WIDGET (treeview), NULL);
gtk_widget_show_all (menu);
event_button = (GdkEventButton *) event;
/* Note: event can be NULL here when called from view_onPopupMenu; */
gtk_menu_popup_at_pointer (GTK_MENU(menu), (GdkEvent*)event);
g_list_free_full (row_info_list, (GDestroyNotify)rowinfo_free);
g_list_free_full (selected_rows, (GDestroyNotify)gtk_tree_path_free);
LEAVE ("");
}
@ -1158,15 +1411,13 @@ gnc_gen_trans_onButtonPressed_cb (GtkTreeView *treeview,
// or the selected transaction is an ADD.
selection = gtk_tree_view_get_selection (treeview);
count = gtk_tree_selection_count_selected_rows (selection);
if (count > 1)
gnc_gen_trans_view_popup_menu (treeview, event, info, FALSE);
else if (count > 0)
if (count > 0)
{
GList* selected;
GtkTreeModel *model;
selected = gtk_tree_selection_get_selected_rows (selection, &model);
if (get_action_for_path (selected->data, model) == GNCImport_ADD)
gnc_gen_trans_view_popup_menu (treeview, event, info, TRUE);
gnc_gen_trans_view_popup_menu (treeview, event, info);
g_list_free_full (selected, (GDestroyNotify)gtk_tree_path_free);
}
LEAVE("return TRUE");
@ -1187,7 +1438,7 @@ gnc_gen_trans_onPopupMenu_cb (GtkTreeView *treeview,
selection = gtk_tree_view_get_selection (treeview);
if (gtk_tree_selection_count_selected_rows (selection) > 0)
{
gnc_gen_trans_view_popup_menu (treeview, NULL, info, TRUE);
gnc_gen_trans_view_popup_menu (treeview, NULL, info);
LEAVE ("TRUE");
return TRUE;
}
@ -1223,6 +1474,12 @@ add_text_column (GtkTreeView *view, const gchar *title, int col_num, gboolean el
else
gtk_tree_view_column_set_sort_column_id (column, col_num);
if (col_num == DOWNLOADED_COL_DESCRIPTION)
gtk_tree_view_column_add_attribute (column, renderer, "style", DOWNLOADED_COL_DESCRIPTION_STYLE);
if (col_num == DOWNLOADED_COL_MEMO)
gtk_tree_view_column_add_attribute (column, renderer, "style", DOWNLOADED_COL_MEMO_STYLE);
g_object_set (G_OBJECT(column),
"reorderable", TRUE,
"resizable", TRUE,
@ -1266,7 +1523,9 @@ gnc_gen_trans_init_view (GNCImportMainMatcher *info,
view = info->view;
store = gtk_tree_store_new (NUM_DOWNLOADED_COLS, G_TYPE_STRING, G_TYPE_INT64,
G_TYPE_STRING, G_TYPE_STRING, G_TYPE_DOUBLE,
G_TYPE_STRING, G_TYPE_STRING, G_TYPE_BOOLEAN,
G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INT, //description stuff
G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INT, //memo stuff
G_TYPE_STRING, G_TYPE_BOOLEAN,
G_TYPE_BOOLEAN, G_TYPE_BOOLEAN, G_TYPE_STRING,
GDK_TYPE_PIXBUF, G_TYPE_POINTER, G_TYPE_STRING,
G_TYPE_BOOLEAN);
@ -1326,7 +1585,8 @@ gnc_gen_trans_init_view (GNCImportMainMatcher *info,
g_signal_connect (view, "popup-menu",
G_CALLBACK(gnc_gen_trans_onPopupMenu_cb), info);
info->acct_id_hash = g_hash_table_new (g_direct_hash, g_direct_equal);
info->acct_id_hash = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL,
(GDestroyNotify)g_hash_table_destroy);
}
static void
@ -1470,6 +1730,12 @@ gnc_gen_trans_list_new (GtkWidget *parent,
info);
// This ensure this dialog is closed when the session is closed.
gnc_gui_component_set_session (info->id, gnc_get_current_session());
info->desc_hash = g_hash_table_new (g_str_hash, g_str_equal);
info->notes_hash = g_hash_table_new (g_str_hash, g_str_equal);
info->memo_hash = g_hash_table_new (g_str_hash, g_str_equal);
info->new_strings = NULL;
return info;
}
@ -1596,9 +1862,19 @@ update_child_row (GNCImportMatchInfo *sel_match, GtkTreeModel *model, GtkTreeIte
ro_text = xaccPrintAmount (xaccSplitGetAmount (sel_match->split),
gnc_split_amount_print_info (sel_match->split, TRUE));
gtk_tree_store_set (store, &child, DOWNLOADED_COL_AMOUNT, ro_text, -1);
gtk_tree_store_set (store, &child, DOWNLOADED_COL_MEMO, memo, -1);
gtk_tree_store_set (store, &child, DOWNLOADED_COL_DESCRIPTION, desc, -1);
gtk_tree_store_set (store, &child,
DOWNLOADED_COL_AMOUNT, ro_text,
-1);
gtk_tree_store_set (store, &child,
DOWNLOADED_COL_MEMO, memo,
DOWNLOADED_COL_MEMO_STYLE, PANGO_STYLE_NORMAL,
-1);
gtk_tree_store_set (store, &child,
DOWNLOADED_COL_DESCRIPTION, desc,
DOWNLOADED_COL_DESCRIPTION_STYLE, PANGO_STYLE_NORMAL,
-1);
gtk_tree_store_set (store, &child, DOWNLOADED_COL_ENABLE, FALSE, -1);
g_free (text);
@ -1680,13 +1956,22 @@ refresh_model_row (GNCImportMainMatcher *gui,
gtk_tree_store_set (store, iter, DOWNLOADED_COL_AMOUNT, ro_text, -1);
gtk_tree_store_set (store, iter, DOWNLOADED_COL_AMOUNT_DOUBLE, gnc_numeric_to_double (amount), -1);
/* Notes */
ro_text = xaccTransGetNotes (gnc_import_TransInfo_get_trans (info));
gtk_tree_store_set (store, iter, DOWNLOADED_COL_NOTES_ORIGINAL, ro_text, -1);
/*Description*/
ro_text = xaccTransGetDescription (gnc_import_TransInfo_get_trans (info) );
gtk_tree_store_set (store, iter, DOWNLOADED_COL_DESCRIPTION, ro_text, -1);
gtk_tree_store_set (store, iter,
DOWNLOADED_COL_DESCRIPTION, ro_text,
DOWNLOADED_COL_DESCRIPTION_ORIGINAL, ro_text,
-1);
/*Memo*/
ro_text = xaccSplitGetMemo (split);
gtk_tree_store_set (store, iter, DOWNLOADED_COL_MEMO, ro_text, -1);
gtk_tree_store_set (store, iter,
DOWNLOADED_COL_MEMO, ro_text,
DOWNLOADED_COL_MEMO_ORIGINAL, ro_text,
-1);
/*Actions*/
@ -2157,10 +2442,14 @@ query_tooltip_tree_view_cb (GtkWidget *widget, gint x, gint y,
switch (num_col)
{
case DOWNLOADED_COL_DESCRIPTION:
gtk_tree_model_get (model, &iter, DOWNLOADED_COL_DESCRIPTION, &tooltip_text, -1);
gtk_tree_model_get (model, &iter,
DOWNLOADED_COL_DESCRIPTION_ORIGINAL, &tooltip_text,
-1);
break;
case DOWNLOADED_COL_MEMO:
gtk_tree_model_get (model, &iter, DOWNLOADED_COL_MEMO, &tooltip_text, -1);
gtk_tree_model_get (model, &iter,
DOWNLOADED_COL_MEMO_ORIGINAL, &tooltip_text,
-1);
break;
default:
break;

View File

@ -40,7 +40,8 @@
* Account, Transaction and Split
\********************************************************************/
const gchar * gnc_import_get_acc_online_id (Account * account)
gchar *
gnc_import_get_acc_online_id (Account * account)
{
gchar *id = NULL;
qof_instance_get (QOF_INSTANCE (account), "online-id", &id, NULL);
@ -49,7 +50,8 @@ const gchar * gnc_import_get_acc_online_id (Account * account)
/* Used in the midst of editing a transaction; make it save the
* account data. */
void gnc_import_set_acc_online_id (Account *account, const gchar *id)
void
gnc_import_set_acc_online_id (Account *account, const gchar *id)
{
g_return_if_fail (account != NULL);
xaccAccountBeginEdit (account);
@ -57,15 +59,17 @@ void gnc_import_set_acc_online_id (Account *account, const gchar *id)
xaccAccountCommitEdit (account);
}
const gchar * gnc_import_get_trans_online_id (Transaction * transaction)
gchar *
gnc_import_get_trans_online_id (Transaction * transaction)
{
gchar *id = NULL;
qof_instance_get (QOF_INSTANCE (transaction), "online-id", &id, NULL);
return id;
}
/* Not actually used */
void gnc_import_set_trans_online_id (Transaction *transaction,
const gchar *id)
void
gnc_import_set_trans_online_id (Transaction *transaction, const gchar *id)
{
g_return_if_fail (transaction != NULL);
xaccTransBeginEdit (transaction);
@ -73,33 +77,40 @@ void gnc_import_set_trans_online_id (Transaction *transaction,
xaccTransCommitEdit (transaction);
}
gboolean gnc_import_trans_has_online_id(Transaction * transaction)
gboolean
gnc_import_trans_has_online_id (Transaction * transaction)
{
const gchar * online_id;
online_id = gnc_import_get_trans_online_id(transaction);
return (online_id != NULL && strlen(online_id) > 0);
gchar *online_id = gnc_import_get_trans_online_id(transaction);
gboolean retval = (online_id && *online_id);
g_free (online_id);
return retval;
}
const gchar * gnc_import_get_split_online_id (Split * split)
gchar *
gnc_import_get_split_online_id (Split * split)
{
gchar *id = NULL;
qof_instance_get (QOF_INSTANCE (split), "online-id", &id, NULL);
return id;
}
/* Used several places in a transaction edit where many other
* parameters are also being set, so individual commits wouldn't be
* appropriate. Besides, there isn't a function for one.*/
void gnc_import_set_split_online_id (Split *split, const gchar *id)
void
gnc_import_set_split_online_id (Split *split, const gchar *id)
{
g_return_if_fail (split != NULL);
qof_instance_set (QOF_INSTANCE (split), "online-id", id, NULL);
}
gboolean gnc_import_split_has_online_id(Split * split)
gboolean
gnc_import_split_has_online_id (Split * split)
{
const gchar * online_id;
online_id = gnc_import_get_split_online_id(split);
return (online_id != NULL && strlen(online_id) > 0);
gchar *online_id = gnc_import_get_split_online_id(split);
gboolean retval = (online_id && *online_id);
g_free (online_id);
return retval;
}
/* @} */

View File

@ -45,7 +45,7 @@
Accounts.
@{
*/
const gchar * gnc_import_get_acc_online_id(Account * account);
gchar * gnc_import_get_acc_online_id(Account * account);
void gnc_import_set_acc_online_id(Account * account,
const gchar * string_value);
/** @} */
@ -54,7 +54,7 @@ void gnc_import_set_acc_online_id(Account * account,
Transactions.
@{
*/
const gchar * gnc_import_get_trans_online_id(Transaction * transaction);
gchar * gnc_import_get_trans_online_id(Transaction * transaction);
void gnc_import_set_trans_online_id(Transaction * transaction,
const gchar * string_value);
/** @} */
@ -66,7 +66,7 @@ gboolean gnc_import_trans_has_online_id(Transaction * transaction);
Splits.
@{
*/
const gchar * gnc_import_get_split_online_id(Split * split);
gchar * gnc_import_get_split_online_id(Split * split);
void gnc_import_set_split_online_id(Split * split,
const gchar * string_value);
/** @} */

View File

@ -60,7 +60,7 @@ typedef struct GncPluginLogreplayPrivate
G_DEFINE_TYPE_WITH_PRIVATE(GncPluginLogreplay, gnc_plugin_log_replay, GNC_TYPE_PLUGIN)
#define GNC_PLUGIN_LOG_REPLAY_GET_PRIVATE(o) \
((GncPluginLogreplayPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_PLUGIN_LOG_REPLAY))
((GncPluginLogreplayPrivate*)gnc_plugin_log_replay_get_instance_private((GncPluginLogReplay*)o))
static GObjectClass *parent_class = NULL;

View File

@ -58,7 +58,7 @@ typedef struct GncPluginOfxPrivate
G_DEFINE_TYPE_WITH_PRIVATE(GncPluginOfx, gnc_plugin_ofx, GNC_TYPE_PLUGIN)
#define GNC_PLUGIN_OFX_GET_PRIVATE(o) \
((GncPluginOfxPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_PLUGIN_OFX))
((GncPluginOfxPrivate*)gnc_plugin_ofx_get_instance_private((GncPluginOfx*)o))
static GObjectClass *parent_class = NULL;

View File

@ -3805,7 +3805,6 @@ gnc_ui_qif_import_assistant_make (QIFImportWindow *qif_win)
GtkWidget *box;
builder = gtk_builder_new ();
gnc_builder_add_from_file (builder, "assistant-qif-import.glade", "currency_liststore");
gnc_builder_add_from_file (builder, "assistant-qif-import.glade", "date_format_liststore");
gnc_builder_add_from_file (builder, "assistant-qif-import.glade", "qif_import_assistant");

View File

@ -60,7 +60,7 @@ typedef struct GncPluginQifImportPrivate
G_DEFINE_TYPE_WITH_PRIVATE(GncPluginQifImport, gnc_plugin_qif_import, GNC_TYPE_PLUGIN);
#define GNC_PLUGIN_QIF_IMPORT_GET_PRIVATE(o) \
((GncPluginQifImportPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_PLUGIN_QIF_IMPORT))
((GncPluginQifImportPrivate*)gnc_plugin_qif_import_get_instance_private((GncPluginQifImport*)o))
static GObjectClass *parent_class = NULL;

View File

@ -530,6 +530,8 @@ gnc_ledger_display_template_gl (char* id)
gnc_split_register_set_template_account (sr, acct);
}
qof_query_destroy (q);
LEAVE ("%p", ld);
return ld;
}

View File

@ -2311,6 +2311,7 @@ gnc_template_register_get_xfrm_entry (VirtualLocation virt_loc,
account = xaccAccountLookup (guid, gnc_get_current_book());
name = account ? gnc_get_account_name_for_split_register (account,
reg->show_leaf_accounts) : NULL;
guid_free (guid);
return name;
}
@ -2322,8 +2323,10 @@ gnc_template_register_get_fdebt_entry (VirtualLocation virt_loc,
{
SplitRegister* reg = user_data;
Split* split = gnc_split_register_get_split (reg, virt_loc.vcell_loc);
char* formula = NULL;
static char* formula = NULL;
g_free (formula);
formula = NULL;
if (split)
{
qof_instance_get (QOF_INSTANCE (split),
@ -2356,8 +2359,10 @@ gnc_template_register_get_fcred_entry (VirtualLocation virt_loc,
{
SplitRegister* reg = user_data;
Split* split = gnc_split_register_get_split (reg, virt_loc.vcell_loc);
char* formula = NULL;
static char* formula = NULL;
g_free (formula);
formula = NULL;
if (split)
{
qof_instance_get (QOF_INSTANCE (split),

View File

@ -817,6 +817,8 @@ gnucash_sheet_finalize (GObject *object)
g_hash_table_destroy (sheet->cursor_styles);
g_hash_table_destroy (sheet->dimensions_hash_table);
g_object_unref (sheet->cursor);
if (G_OBJECT_CLASS(sheet_parent_class)->finalize)
(*G_OBJECT_CLASS(sheet_parent_class)->finalize)(object);
}

View File

@ -973,8 +973,7 @@ be excluded from periodic reporting.")
(gnc:register-trep-option
(gnc:make-complex-boolean-option
gnc:pagename-display (N_ "Memo")
"d" (G_ "Display the memo?") disp-memo?
disp-memo?
"d" (G_ "Display the memo?") disp-memo? #f
(lambda (x)
(set! disp-memo? x)
(apply-selectable-by-name-display-options))))
@ -983,8 +982,7 @@ be excluded from periodic reporting.")
(gnc:register-trep-option
(gnc:make-complex-boolean-option
gnc:pagename-display (N_ "Account Name")
"e" (G_ "Display the account name?") disp-accname?
disp-accname?
"e" (G_ "Display the account name?") disp-accname? #f
(lambda (x)
(set! disp-accname? x)
(apply-selectable-by-name-display-options))))
@ -993,8 +991,7 @@ be excluded from periodic reporting.")
(gnc:register-trep-option
(gnc:make-complex-boolean-option
gnc:pagename-display (N_ "Other Account Name")
"h5" (G_ "Display the other account name? (if this is a split transaction, this parameter is guessed).") disp-other-accname?
disp-other-accname?
"h5" (G_ "Display the other account name? (if this is a split transaction, this parameter is guessed).") disp-other-accname? #f
(lambda (x)
(set! disp-other-accname? x)
(apply-selectable-by-name-display-options))))

View File

@ -51,6 +51,12 @@
<menuitem name="ViewToolbar" action="ViewToolbarAction"/>
<menuitem name="ViewSummary" action="ViewSummaryAction"/>
<menuitem name="ViewStatusbar" action="ViewStatusbarAction"/>
<menu name="ViewTabPosition" action="ViewTabPositionAction">
<menuitem name="ViewTabPositionTop" action="ViewTabPositionTopAction"/>
<menuitem name="ViewTabPositionBottom" action="ViewTabPositionBottomAction"/>
<menuitem name="ViewTabPositionLeft" action="ViewTabPositionLeftAction"/>
<menuitem name="ViewTabPositionRight" action="ViewTabPositionRightAction"/>
</menu>
<separator name="ViewSep1"/>
<placeholder name="ViewContentPlaceholder"/>
<separator name="ViewSep2"/>

View File

@ -88,40 +88,46 @@ static void _gnc_sx_instance_event_handler(QofInstance *ent, QofEventId event_ty
static gnc_commodity* get_transaction_currency(SxTxnCreationData *creation_data, SchedXaction *sx, Transaction *template_txn);
/* ------------------------------------------------------------ */
static gboolean
scrub_sx_split_numeric (Split* split, const char *debcred)
typedef struct
{
const gboolean is_credit = g_strcmp0 (debcred, "credit") == 0;
const char *formula = is_credit ?
"sx-credit-formula" : "sx-debit-formula";
const char *numeric = is_credit ?
"sx-credit-numeric" : "sx-debit-numeric";
const char *name;
gnc_numeric amount;
} ScrubItem;
static void
scrub_sx_split_numeric (Split* split, gboolean is_credit, GList **changes)
{
const char *formula = is_credit ? "sx-credit-formula" : "sx-debit-formula";
const char *numeric = is_credit ? "sx-credit-numeric" : "sx-debit-numeric";
char *formval;
gnc_numeric *numval = NULL;
GHashTable *parser_vars = g_hash_table_new (g_str_hash, g_str_equal);
GHashTable *parser_vars = g_hash_table_new_full
(g_str_hash, g_str_equal, g_free, (GDestroyNotify)gnc_sx_variable_free);
char *error_loc;
gnc_numeric amount = gnc_numeric_zero ();
gboolean parse_result = FALSE;
gboolean num_val_changed = FALSE;
qof_instance_get (QOF_INSTANCE (split),
formula, &formval,
numeric, &numval,
NULL);
parse_result =
gnc_exp_parser_parse_separate_vars (formval, &amount,
&error_loc, parser_vars);
qof_instance_get (QOF_INSTANCE (split), formula, &formval,
numeric, &numval, NULL);
parse_result = gnc_exp_parser_parse_separate_vars (formval, &amount,
&error_loc, parser_vars);
if (!parse_result || g_hash_table_size (parser_vars) != 0)
amount = gnc_numeric_zero ();
g_hash_table_unref (parser_vars);
if (!numval || !gnc_numeric_eq (amount, *numval))
{
qof_instance_set (QOF_INSTANCE (split),
numeric, &amount,
NULL);
num_val_changed = TRUE;
ScrubItem *change = g_new (ScrubItem, 1);
change->name = numeric;
change->amount = amount;
*changes = g_list_prepend (*changes, change);
}
g_free (formval);
g_free (numval);
return num_val_changed;
}
/* Fixes error in pre-2.6.16 where the numeric slot wouldn't get changed if the
@ -132,14 +138,20 @@ gnc_sx_scrub_split_numerics (gpointer psplit, gpointer puser)
{
Split *split = GNC_SPLIT (psplit);
Transaction *trans = xaccSplitGetParent (split);
gboolean changed;
GList *changes = NULL;
scrub_sx_split_numeric (split, TRUE, &changes);
scrub_sx_split_numeric (split, FALSE, &changes);
if (!changes)
return;
xaccTransBeginEdit (trans);
changed = scrub_sx_split_numeric (split, "credit") +
scrub_sx_split_numeric (split, "debit");
if (!changed)
xaccTransRollbackEdit (trans);
else
xaccTransCommitEdit (trans);
for (GList *n = changes; n; n = n->next)
{
ScrubItem *change = n->data;
qof_instance_set (QOF_INSTANCE (split), change->name, &change->amount, NULL);
}
xaccTransCommitEdit (trans);
g_list_free_full (changes, g_free);
}
static void
@ -194,7 +206,8 @@ GHashTable*
gnc_sx_instance_get_variables_for_parser(GHashTable *instance_var_hash)
{
GHashTable *parser_vars;
parser_vars = g_hash_table_new(g_str_hash, g_str_equal);
parser_vars = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
g_hash_table_foreach(instance_var_hash, (GHFunc)_sx_var_to_raw_numeric, parser_vars);
return parser_vars;
}
@ -1053,6 +1066,8 @@ _get_sx_formula_value(const SchedXaction* sx,
* localization problems with separators. */
numeric->num = numeric_val->num;
numeric->denom = numeric_val->denom;
g_free (formula_str);
g_free (numeric_val);
return;
}
@ -1082,6 +1097,8 @@ _get_sx_formula_value(const SchedXaction* sx,
g_hash_table_destroy(parser_vars);
}
}
g_free (formula_str);
g_free (numeric_val);
}
static void

View File

@ -59,7 +59,7 @@ extern "C"
#define GNC_LIB_REL_PATH "xml"
static void
remove_files_pattern (const char* begining, const char* ending)
remove_files_pattern (const char* beginning, const char* ending)
{
}

View File

@ -138,7 +138,7 @@ enum
};
#define GET_PRIVATE(o) \
((AccountPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_ACCOUNT))
((AccountPrivate*)gnc_account_get_instance_private((Account*)o))
/* This map contains a set of strings representing the different column types. */
static const std::map<GNCAccountType, const char*> gnc_acct_debit_strs = {
@ -6080,10 +6080,13 @@ gnc_account_delete_all_bayes_maps (Account *acc)
{
auto slots = qof_instance_get_slots_prefix (QOF_INSTANCE (acc), IMAP_FRAME_BAYES);
if (!slots.size()) return;
xaccAccountBeginEdit (acc);
for (auto const & entry : slots)
{
qof_instance_slot_path_delete (QOF_INSTANCE (acc), {entry.first});
}
qof_instance_set_dirty (QOF_INSTANCE(acc));
xaccAccountCommitEdit (acc);
}
}

Some files were not shown because too many files have changed in this diff Show More