Bug #659504 - Migrate Register and reconcile from GladeXML to Builder

Patch by Robert Fewel

Note: this patch is limited to the conversion of widgets found in
the libglade files. Both the Register and the Reconcile features still
depend on deprecated Gtk/Gnome widgets (like GtkCList), which are added
programmatically. Eventually these widgets still have to be replaced
with supported alternatives.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@21358 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Geert Janssens 2011-09-28 13:00:11 +00:00
parent 35ae5e34a8
commit f9ff7a9c2c
11 changed files with 768 additions and 3201 deletions

View File

@ -210,8 +210,6 @@ src/gnome/dialog-sx-since-last-run.c
src/gnome/dialog-tax-info.c
src/gnome/glade/newuser.glade
src/gnome/glade/progress.glade
src/gnome/glade/reconcile.glade
src/gnome/glade/register.glade
src/gnome/glade/sched-xact.glade
src/gnome/glade/tax.glade
src/gnome/glade/userpass.glade
@ -236,14 +234,15 @@ src/gnome/gtkbuilder/dialog-price.glade
src/gnome/gtkbuilder/dialog-print-check.glade
src/gnome/gtkbuilder/dialog-sx.glade
src/gnome/gtkbuilder/gnc-plugin-page-budget.glade
src/gnome/gtkbuilder/gnc-plugin-page-register.glade
src/gnome/gtkbuilder/newuser.glade
src/gnome/gtkbuilder/owner.glade
src/gnome/gtkbuilder/progress.glade
src/gnome/gtkbuilder/reconcile.glade
src/gnome/gtkbuilder/register.glade
src/gnome/gtkbuilder/sched-xact.glade
src/gnome/gtkbuilder/tax.glade
src/gnome/gtkbuilder/userpass.glade
src/gnome/gtkbuilder/window-autoclear.glade
src/gnome/gtkbuilder/window-reconcile.glade
src/gnome/reconcile-list.c
src/gnome/schemas/apps_gnucash_dialog_commodities.schemas.in
src/gnome/schemas/apps_gnucash_dialog_common.schemas.in

View File

@ -2,8 +2,6 @@ gladedir = $(GNC_GLADE_DIR)
glade_DATA = \
newuser.glade \
progress.glade \
reconcile.glade \
register.glade \
tax.glade \
userpass.glade \
sched-xact.glade

View File

@ -1,226 +0,0 @@
<?xml version="1.0"?>
<glade-interface>
<!-- interface-requires gtk+ 2.10 -->
<!-- interface-naming-policy toplevel-contextual -->
<widget class="GtkDialog" id="Reconcile Start Dialog">
<property name="visible">True</property>
<property name="resizable">False</property>
<property name="type_hint">dialog</property>
<child internal-child="vbox">
<widget class="GtkVBox" id="dialog-vbox6">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
<widget class="GtkVBox" id="vbox1">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
<widget class="GtkLabel" id="label1">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">&lt;b&gt;Reconcile Information&lt;/b&gt;</property>
<property name="use_markup">True</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<widget class="GtkAlignment" id="alignment1">
<property name="visible">True</property>
<property name="left_padding">12</property>
<child>
<widget class="GtkTable" id="table1">
<property name="visible">True</property>
<property name="border_width">10</property>
<property name="n_rows">4</property>
<property name="n_columns">2</property>
<property name="column_spacing">4</property>
<property name="row_spacing">6</property>
<child>
<widget class="GtkLabel" id="start_value">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label">$15.00</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="date_label">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Statement _Date:</property>
<property name="use_underline">True</property>
</widget>
</child>
<child>
<widget class="GtkLabel" id="start_label">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Starting Balance:</property>
</widget>
<packing>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="end_label">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">_Ending Balance:</property>
<property name="use_underline">True</property>
</widget>
<packing>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
</packing>
</child>
<child>
<widget class="GtkCheckButton" id="subaccount_check">
<property name="label" translatable="yes">Include _subaccounts</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_underline">True</property>
<property name="draw_indicator">True</property>
<signal name="toggled" handler="gnc_start_recn_children_changed"/>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">3</property>
<property name="bottom_attach">4</property>
</packing>
</child>
<child>
<widget class="GtkHBox" id="date_value_box">
<property name="visible">True</property>
<child>
<placeholder/>
</child>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options">GTK_FILL</property>
</packing>
</child>
<child>
<widget class="GtkHBox" id="ending_value_box">
<property name="visible">True</property>
<child>
<placeholder/>
</child>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options">GTK_FILL</property>
</packing>
</child>
<child>
<placeholder/>
</child>
</widget>
</child>
</widget>
<packing>
<property name="position">1</property>
</packing>
</child>
<child>
<widget class="GtkHButtonBox" id="hbuttonbox1">
<property name="visible">True</property>
<child>
<widget class="GtkButton" id="interest_button">
<property name="label" translatable="yes">Enter _Interest Payment...</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="border_width">8</property>
<property name="use_underline">True</property>
<signal name="clicked" handler="gnc_start_recn_interest_clicked_cb"/>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
</widget>
<packing>
<property name="position">2</property>
</packing>
</child>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="padding">5</property>
<property name="position">2</property>
</packing>
</child>
<child internal-child="action_area">
<widget class="GtkHButtonBox" id="dialog-action_area6">
<property name="visible">True</property>
<property name="layout_style">end</property>
<child>
<widget class="GtkButton" id="cancelbutton1">
<property name="label">gtk-cancel</property>
<property name="response_id">-6</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_stock">True</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<widget class="GtkButton" id="okbutton1">
<property name="label">gtk-ok</property>
<property name="response_id">-5</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="has_default">True</property>
<property name="receives_default">False</property>
<property name="use_stock">True</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
</widget>
<packing>
<property name="expand">False</property>
<property name="pack_type">end</property>
<property name="position">0</property>
</packing>
</child>
</widget>
</child>
</widget>
</glade-interface>

File diff suppressed because it is too large Load Diff

View File

@ -1,26 +1,27 @@
/*
* gnc-plugin-page-register.c --
*
* Copyright (C) 2003 Jan Arne Petersen <jpetersen@uni-bonn.de>
* Copyright (C) 2003,2005,2006 David Hampton <hampton@employees.org>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, contact:
*
* Free Software Foundation Voice: +1-617-542-5942
* 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652
* Boston, MA 02110-1301, USA gnu@gnu.org
*/
/**********************************************************************
* gnc-plugin-page-register.c -- register page functions *
* *
* Copyright (C) 2003 Jan Arne Petersen <jpetersen@uni-bonn.de> *
* Copyright (C) 2003,2005,2006 David Hampton <hampton@employees.org> *
* Copyright (C) 2011, Robert Fewell *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License as *
* published by the Free Software Foundation; either version 2 of *
* the License, or (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, contact: *
* *
* Free Software Foundation Voice: +1-617-542-5942 *
* 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
* Boston, MA 02110-1301, USA gnu@gnu.org *
**********************************************************************/
/** @addtogroup ContentPlugins
@{ */
@ -342,6 +343,7 @@ static GtkActionEntry gnc_plugin_page_register_actions [] =
G_CALLBACK (gnc_plugin_page_register_cmd_transaction_report)
},
};
static guint gnc_plugin_page_register_n_actions = G_N_ELEMENTS (gnc_plugin_page_register_actions);
static GtkToggleActionEntry toggle_entries[] =
@ -358,6 +360,7 @@ static GtkToggleActionEntry toggle_entries[] =
G_CALLBACK (gnc_plugin_page_register_cmd_expand_transaction), FALSE
},
};
static guint n_toggle_entries = G_N_ELEMENTS (toggle_entries);
static GtkRadioActionEntry radio_entries_2 [] =
@ -378,8 +381,8 @@ static GtkRadioActionEntry radio_entries_2 [] =
N_("Show expanded transactions with all splits"), REG_STYLE_JOURNAL
}
};
static guint n_radio_entries_2 = G_N_ELEMENTS (radio_entries_2);
static guint n_radio_entries_2 = G_N_ELEMENTS (radio_entries_2);
/** These are the "important" actions provided by the register page.
* Their labels will appear when the toolbar is set to "Icons and
@ -390,7 +393,6 @@ static const gchar *important_actions[] =
NULL,
};
/** Actions that require an account to be selected before they are
* enabled. */
static const gchar *actions_requiring_account[] =
@ -402,7 +404,6 @@ static const gchar *actions_requiring_account[] =
NULL
};
/** View Style actions */
static const gchar *view_style_actions[] =
{
@ -412,7 +413,6 @@ static const gchar *view_style_actions[] =
NULL
};
/** Short labels for use on the toolbar buttons. */
static action_toolbar_labels toolbar_labels[] =
{
@ -429,20 +429,21 @@ static action_toolbar_labels toolbar_labels[] =
{ NULL, NULL },
};
struct status_action
{
const char *action_name;
int value;
GtkWidget *widget;
};
static struct status_action status_actions[] =
{
{ "filter_status_reconciled", CLEARED_RECONCILED },
{ "filter_status_cleared", CLEARED_CLEARED },
{ "filter_status_voided", CLEARED_VOIDED },
{ "filter_status_frozen", CLEARED_FROZEN },
{ "filter_status_unreconciled", CLEARED_NO },
{ NULL, 0 },
{ "filter_status_reconciled", CLEARED_RECONCILED, NULL },
{ "filter_status_cleared", CLEARED_CLEARED, NULL },
{ "filter_status_voided", CLEARED_VOIDED, NULL },
{ "filter_status_frozen", CLEARED_FROZEN, NULL },
{ "filter_status_unreconciled", CLEARED_NO, NULL },
{ NULL, 0, NULL },
};
#define CLEARED_VALUE "cleared_value"
@ -474,6 +475,13 @@ typedef struct GncPluginPageRegisterPrivate
struct
{
GtkWidget *dialog;
GtkWidget *table;
GtkWidget *start_date_choose;
GtkWidget *start_date_today;
GtkWidget *start_date;
GtkWidget *end_date_choose;
GtkWidget *end_date_today;
GtkWidget *end_date;
cleared_match_t original_cleared_match;
cleared_match_t cleared_match;
time_t original_start_time;
@ -700,7 +708,6 @@ gnc_plugin_page_register_finalize (GObject *object)
LEAVE(" ");
}
Account *
gnc_plugin_page_register_get_account (GncPluginPageRegister *page)
{
@ -717,7 +724,6 @@ gnc_plugin_page_register_get_account (GncPluginPageRegister *page)
return NULL;
}
static void
gnc_plugin_page_register_ui_update (gpointer various, GncPluginPageRegister *page)
{
@ -1465,7 +1471,7 @@ gnc_plugin_page_register_sort_button_cb (GtkToggleButton *button,
g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
name = gtk_widget_get_name(GTK_WIDGET(button));
name = gtk_buildable_get_name(GTK_BUILDABLE(button));
ENTER("button %s(%p), page %p", name, button, page);
type = SortTypefromString(name);
gnc_split_reg_set_sort_type(priv->gsr, type);
@ -1598,7 +1604,7 @@ gnc_plugin_page_register_filter_status_one_cb (GtkToggleButton *button,
g_return_if_fail(GTK_IS_CHECK_BUTTON(button));
g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
name = gtk_widget_get_name(GTK_WIDGET(button));
name = gtk_buildable_get_name(GTK_BUILDABLE(button));
ENTER("toggle button %s (%p), plugin_page %p", name, button, page);
/* Determine what status bit to change */
@ -1648,8 +1654,7 @@ gnc_plugin_page_register_filter_status_all_cb (GtkButton *button,
/* Turn on all the check menu items */
for (i = 0; status_actions[i].action_name; i++)
{
widget = gnc_glade_lookup_widget(GTK_WIDGET(button),
status_actions[i].action_name);
widget = status_actions[i].widget;
g_signal_handlers_block_by_func(widget, gnc_plugin_page_register_filter_status_one_cb, page);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(widget), TRUE);
g_signal_handlers_unblock_by_func(widget, gnc_plugin_page_register_filter_status_one_cb, page);
@ -1682,18 +1687,15 @@ get_filter_times(GncPluginPageRegister *page)
time_t time_val;
priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
button = gnc_glade_lookup_widget(priv->fd.dialog, "start_date_choose");
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(button)))
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(priv->fd.start_date_choose)))
{
gde = gnc_glade_lookup_widget(button, "start_date");
time_val = gnc_date_edit_get_date(GNC_DATE_EDIT(gde));
time_val = gnc_date_edit_get_date(GNC_DATE_EDIT(priv->fd.start_date));
time_val = gnc_timet_get_day_start(time_val);
priv->fd.start_time = time_val;
}
else
{
today = gnc_glade_lookup_widget(priv->fd.dialog, "start_date_today");
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(today)))
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(priv->fd.start_date_today)))
{
priv->fd.start_time = gnc_timet_get_today_start();
}
@ -1703,18 +1705,15 @@ get_filter_times(GncPluginPageRegister *page)
}
}
button = gnc_glade_lookup_widget(priv->fd.dialog, "end_date_choose");
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(button)))
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(priv->fd.end_date_choose)))
{
gde = gnc_glade_lookup_widget(button, "end_date");
time_val = gnc_date_edit_get_date(GNC_DATE_EDIT(gde));
time_val = gnc_date_edit_get_date(GNC_DATE_EDIT(priv->fd.end_date));
time_val = gnc_timet_get_day_end(time_val);
priv->fd.end_time = time_val;
}
else
{
today = gnc_glade_lookup_widget(priv->fd.dialog, "end_date_today");
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(today)))
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(priv->fd.start_date_today)))
{
priv->fd.end_time = gnc_timet_get_today_end();
}
@ -1746,7 +1745,6 @@ gnc_plugin_page_register_filter_select_range_cb (GtkRadioButton *button,
GncPluginPageRegister *page)
{
GncPluginPageRegisterPrivate *priv;
GtkWidget *table;
gboolean active;
g_return_if_fail(GTK_IS_RADIO_BUTTON(button));
@ -1754,9 +1752,8 @@ gnc_plugin_page_register_filter_select_range_cb (GtkRadioButton *button,
ENTER("(button %p, page %p)", button, page);
priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
table = gnc_glade_lookup_widget(GTK_WIDGET(button), "select_range_table");
active = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(button));
gtk_widget_set_sensitive(table, active);
gtk_widget_set_sensitive(priv->fd.table, active);
if (active)
{
get_filter_times(page);
@ -1787,7 +1784,7 @@ gnc_plugin_page_register_filter_gde_changed_cb (GtkWidget *unused,
{
g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
ENTER("(widget %s(%p), page %p)", gtk_widget_get_name(unused), unused, page);
ENTER("(widget %s(%p), page %p)", gtk_buildable_get_name(GTK_BUILDABLE(unused)), unused, page);
get_filter_times(page);
gnc_ppr_update_date_query(page);
LEAVE(" ");
@ -1817,24 +1814,24 @@ void
gnc_plugin_page_register_filter_start_cb (GtkWidget *radio,
GncPluginPageRegister *page)
{
GtkWidget *widget, *gde;
GncPluginPageRegisterPrivate *priv;
const gchar *name;
gboolean active;
g_return_if_fail(GTK_IS_RADIO_BUTTON(radio));
g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
ENTER("(radio %s(%p), page %p)", gtk_widget_get_name(radio), radio, page);
ENTER("(radio %s(%p), page %p)", gtk_buildable_get_name(GTK_BUILDABLE(radio)), radio, page);
priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
if (!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(radio)))
{
LEAVE("1st callback of pair. Defer to 2nd callback.");
return;
}
widget = gnc_glade_lookup_widget(radio, "start_date_choose");
active = (widget == radio);
gde = gnc_glade_lookup_widget(radio, "start_date");
gtk_widget_set_sensitive(gde, active);
name = gtk_buildable_get_name(GTK_BUILDABLE(radio));
active = ( strcmp(name, g_strdup("start_date_choose")) == 0 ? 1 : 0 );
gtk_widget_set_sensitive(priv->fd.start_date, active);
get_filter_times(page);
gnc_ppr_update_date_query(page);
LEAVE(" ");
@ -1864,24 +1861,24 @@ void
gnc_plugin_page_register_filter_end_cb (GtkWidget *radio,
GncPluginPageRegister *page)
{
GtkWidget *widget, *gde;
GncPluginPageRegisterPrivate *priv;
const gchar *name;
gboolean active;
g_return_if_fail(GTK_IS_RADIO_BUTTON(radio));
g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
ENTER("(radio %s(%p), page %p)", gtk_widget_get_name(radio), radio, page);
ENTER("(radio %s(%p), page %p)", gtk_buildable_get_name(GTK_BUILDABLE(radio)), radio, page);
priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
if (!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(radio)))
{
LEAVE("1st callback of pair. Defer to 2nd callback.");
return;
}
widget = gnc_glade_lookup_widget(radio, "end_date_choose");
active = (widget == radio);
gde = gnc_glade_lookup_widget(radio, "end_date");
gtk_widget_set_sensitive(gde, active);
name = gtk_buildable_get_name(GTK_BUILDABLE(radio));
active = ( strcmp(name, g_strdup("end_date_choose")) == 0 ? 1 : 0 );
gtk_widget_set_sensitive(priv->fd.end_date, active);
get_filter_times(page);
gnc_ppr_update_date_query(page);
LEAVE(" ");
@ -2300,7 +2297,7 @@ gnc_plugin_page_register_cmd_void_transaction (GtkAction *action,
GtkWidget *dialog, *entry;
SplitRegister *reg;
Transaction *trans;
GladeXML *xml;
GtkBuilder *builder;
const char *reason;
gint result;
@ -2324,9 +2321,10 @@ gnc_plugin_page_register_cmd_void_transaction (GtkAction *action,
if (!gnc_plugin_page_register_finish_pending(GNC_PLUGIN_PAGE(page)))
return;
xml = gnc_glade_xml_new("register.glade", "Void Transaction");
dialog = glade_xml_get_widget(xml, "Void Transaction");
entry = glade_xml_get_widget(xml, "reason");
builder = gtk_builder_new();
gnc_builder_add_from_file (builder ,"gnc-plugin-page-register.glade", "Void Transaction");
dialog = GTK_WIDGET(gtk_builder_get_object (builder, "Void Transaction"));
entry = GTK_WIDGET(gtk_builder_get_object (builder, "reason"));
result = gtk_dialog_run(GTK_DIALOG(dialog));
if (result == GTK_RESPONSE_OK)
@ -2339,7 +2337,7 @@ gnc_plugin_page_register_cmd_void_transaction (GtkAction *action,
/* All done. Get rid of it. */
gtk_widget_destroy(dialog);
g_object_unref(xml);
g_object_unref(G_OBJECT(builder));
}
@ -2442,7 +2440,7 @@ gnc_plugin_page_register_cmd_view_sort_by (GtkAction *action,
{
GncPluginPageRegisterPrivate *priv;
GtkWidget *dialog, *button;
GladeXML *xml;
GtkBuilder *builder;
SortType sort;
const gchar *name;
gchar *title;
@ -2459,8 +2457,10 @@ gnc_plugin_page_register_cmd_view_sort_by (GtkAction *action,
}
/* Create the dialog */
xml = gnc_glade_xml_new ("register.glade", "Sort By");
dialog = glade_xml_get_widget (xml, "Sort By");
builder = gtk_builder_new();
gnc_builder_add_from_file (builder, "gnc-plugin-page-register.glade", "Sort By");
dialog = GTK_WIDGET(gtk_builder_get_object (builder, "Sort By"));
priv->sd.dialog = dialog;
gtk_window_set_transient_for(GTK_WINDOW(dialog),
gnc_window_get_gtk_window(GNC_WINDOW(GNC_PLUGIN_PAGE(page)->window)));
@ -2473,17 +2473,17 @@ gnc_plugin_page_register_cmd_view_sort_by (GtkAction *action,
/* Set the button for the current sort order */
sort = gnc_split_reg_get_sort_type(priv->gsr);
name = SortTypeasString(sort);
button = glade_xml_get_widget (xml, name);
button = GTK_WIDGET(gtk_builder_get_object (builder, name));
DEBUG("current sort %d, button %s(%p)", sort, name, button);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), TRUE);
priv->sd.original_sort_type = sort;
/* Wire it up */
glade_xml_signal_autoconnect_full(xml, gnc_glade_autoconnect_full_func,
page);
gtk_builder_connect_signals_full (builder, gnc_builder_connect_full_func, page);
/* Show it */
gtk_widget_show(dialog);
g_object_unref(G_OBJECT(builder));
LEAVE(" ");
}
@ -2492,9 +2492,9 @@ gnc_plugin_page_register_cmd_view_filter_by (GtkAction *action,
GncPluginPageRegister *page)
{
GncPluginPageRegisterPrivate *priv;
GtkWidget *dialog, *toggle, *button, *start_date, *end_date, *table;
GtkWidget *dialog, *toggle, *button, *start_date, *end_date, *table, *hbox;
time_t start_time, end_time, time_val;
GladeXML *xml;
GtkBuilder *builder;
gboolean sensitive, value;
Query *query;
gchar *title;
@ -2512,11 +2512,13 @@ gnc_plugin_page_register_cmd_view_filter_by (GtkAction *action,
}
/* Create the dialog */
xml = gnc_glade_xml_new ("register.glade", "Filter By");
dialog = glade_xml_get_widget (xml, "Filter By");
builder = gtk_builder_new();
gnc_builder_add_from_file (builder, "gnc-plugin-page-register.glade", "Filter By");
dialog = GTK_WIDGET(gtk_builder_get_object (builder, "Filter By"));
priv->fd.dialog = dialog;
gtk_window_set_transient_for(GTK_WINDOW(dialog),
gnc_window_get_gtk_window(GNC_WINDOW(GNC_PLUGIN_PAGE(page)->window)));
/* Translators: The %s is the name of the plugin page */
title = g_strdup_printf(_("Filter %s by..."),
gnc_plugin_page_get_page_name(GNC_PLUGIN_PAGE(page)));
@ -2526,14 +2528,15 @@ gnc_plugin_page_register_cmd_view_filter_by (GtkAction *action,
/* Set the check buttons for the current status */
for (i = 0; status_actions[i].action_name; i++)
{
toggle = glade_xml_get_widget (xml, status_actions[i].action_name);
toggle = GTK_WIDGET(gtk_builder_get_object (builder, status_actions[i].action_name));
value = priv->fd.cleared_match & status_actions[i].value;
status_actions[i].widget = toggle;
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle), value);
}
priv->fd.original_cleared_match = priv->fd.cleared_match;
/* Set the date info */
button = glade_xml_get_widget(xml, "filter_show_range");
button = GTK_WIDGET(gtk_builder_get_object (builder, "filter_show_range"));
query = gnc_ledger_display_get_query (priv->ledger);
xaccQueryGetDateMatchTT(query, &start_time, &end_time);
priv->fd.original_start_time = start_time;
@ -2541,16 +2544,21 @@ gnc_plugin_page_register_cmd_view_filter_by (GtkAction *action,
priv->fd.original_end_time = end_time;
priv->fd.end_time = end_time;
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button),
start_time || end_time);
table = glade_xml_get_widget(xml, "select_range_table");
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), start_time || end_time);
table = GTK_WIDGET(gtk_builder_get_object (builder, "select_range_table"));
priv->fd.table = table;
gtk_widget_set_sensitive(GTK_WIDGET(table), start_time || end_time);
priv->fd.start_date_choose = GTK_WIDGET(gtk_builder_get_object (builder, "start_date_choose"));
priv->fd.start_date_today = GTK_WIDGET(gtk_builder_get_object (builder, "start_date_today"));
priv->fd.end_date_choose = GTK_WIDGET(gtk_builder_get_object (builder, "end_date_choose"));
priv->fd.end_date_today = GTK_WIDGET(gtk_builder_get_object (builder, "end_date_today"));
{
/* Start date info */
if (start_time == 0)
{
button = glade_xml_get_widget(xml, "start_date_earliest");
button = GTK_WIDGET(gtk_builder_get_object (builder, "start_date_earliest"));
time_val = xaccQueryGetEarliestDateFound (query);
sensitive = FALSE;
}
@ -2560,20 +2568,23 @@ gnc_plugin_page_register_cmd_view_filter_by (GtkAction *action,
if ((start_time >= gnc_timet_get_today_start()) &&
(start_time <= gnc_timet_get_today_end()))
{
button = glade_xml_get_widget(xml, "start_date_today");
button = priv->fd.start_date_today;
sensitive = FALSE;
}
else
{
button = glade_xml_get_widget(xml, "start_date_choose");
button = priv->fd.start_date_choose;
sensitive = TRUE;
}
}
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), TRUE);
start_date = glade_xml_get_widget(xml, "start_date");
gtk_widget_set_sensitive(GTK_WIDGET(start_date), sensitive);
gnc_date_edit_set_time(GNC_DATE_EDIT(start_date), time_val);
g_signal_connect (G_OBJECT (start_date), "date-changed",
priv->fd.start_date = gnc_date_edit_new (time (NULL), FALSE, FALSE);
hbox = GTK_WIDGET(gtk_builder_get_object (builder, "start_date_hbox"));
gtk_box_pack_start (GTK_BOX (hbox), priv->fd.start_date, TRUE, TRUE, 0);
gtk_widget_show (priv->fd.start_date);
gtk_widget_set_sensitive(GTK_WIDGET(priv->fd.start_date), sensitive);
gnc_date_edit_set_time(GNC_DATE_EDIT(priv->fd.start_date), time_val);
g_signal_connect (G_OBJECT (priv->fd.start_date), "date-changed",
G_CALLBACK (gnc_plugin_page_register_filter_gde_changed_cb),
page);
}
@ -2582,7 +2593,7 @@ gnc_plugin_page_register_cmd_view_filter_by (GtkAction *action,
/* End date info */
if (end_time == 0)
{
button = glade_xml_get_widget(xml, "end_date_latest");
button = GTK_WIDGET(gtk_builder_get_object (builder, "end_date_latest"));
time_val = xaccQueryGetLatestDateFound (query);
sensitive = FALSE;
}
@ -2592,29 +2603,33 @@ gnc_plugin_page_register_cmd_view_filter_by (GtkAction *action,
if ((end_time >= gnc_timet_get_today_start()) &&
(end_time <= gnc_timet_get_today_end()))
{
button = glade_xml_get_widget(xml, "end_date_today");
button = priv->fd.end_date_today;
sensitive = FALSE;
}
else
{
button = glade_xml_get_widget(xml, "end_date_choose");
button = priv->fd.end_date_choose;
sensitive = TRUE;
}
}
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), TRUE);
end_date = glade_xml_get_widget(xml, "end_date");
gtk_widget_set_sensitive(GTK_WIDGET(end_date), sensitive);
gnc_date_edit_set_time(GNC_DATE_EDIT(end_date), time_val);
g_signal_connect (G_OBJECT (end_date), "date-changed",
priv->fd.end_date = gnc_date_edit_new (time (NULL), FALSE, FALSE);
hbox = GTK_WIDGET(gtk_builder_get_object (builder, "end_date_hbox"));
gtk_box_pack_start (GTK_BOX (hbox), priv->fd.end_date, TRUE, TRUE, 0);
gtk_widget_show (priv->fd.end_date);
gtk_widget_set_sensitive(GTK_WIDGET(priv->fd.end_date), sensitive);
gnc_date_edit_set_time(GNC_DATE_EDIT(priv->fd.end_date), time_val);
g_signal_connect (G_OBJECT (priv->fd.end_date), "date-changed",
G_CALLBACK (gnc_plugin_page_register_filter_gde_changed_cb),
page);
}
/* Wire it up */
glade_xml_signal_autoconnect_full(xml, gnc_glade_autoconnect_full_func, page);
gtk_builder_connect_signals_full (builder, gnc_builder_connect_full_func, page);
/* Show it */
gtk_widget_show_all(dialog);
g_object_unref(G_OBJECT(builder));
LEAVE(" ");
}

View File

@ -1,26 +1,26 @@
/*
* gnc-plugin-page-register.h --
*
* Copyright (C) 2003 Jan Arne Petersen <jpetersen@uni-bonn.de>
* Copyright (C) 2003 David Hampton <hampton@employees.org>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, contact:
*
* Free Software Foundation Voice: +1-617-542-5942
* 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652
* Boston, MA 02110-1301, USA gnu@gnu.org
*/
/**********************************************************************
* gnc-plugin-page-register.h -- register page functions *
* *
* Copyright (C) 2003 Jan Arne Petersen <jpetersen@uni-bonn.de> *
* Copyright (C) 2003,2005,2006 David Hampton <hampton@employees.org> *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License as *
* published by the Free Software Foundation; either version 2 of *
* the License, or (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, contact: *
* *
* Free Software Foundation Voice: +1-617-542-5942 *
* 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
* Boston, MA 02110-1301, USA gnu@gnu.org *
**********************************************************************/
/** @addtogroup ContentPlugins
@{ */

View File

@ -10,15 +10,15 @@ gtkbuilder_DATA = \
dialog-fincalc.glade \
dialog-price.glade \
dialog-print-check.glade \
dialog-sx.glade \
dialog-sx.glade \
gnc-plugin-page-budget.glade \
gnc-plugin-page-register.glade \
newuser.glade \
owner.glade \
progress.glade \
reconcile.glade \
register.glade \
tax.glade \
userpass.glade \
window-autoclear.glade
window-autoclear.glade \
window-reconcile.glade
EXTRA_DIST = $(gtkbuilder_DATA)

View File

@ -59,37 +59,38 @@
struct _RecnWindow
{
GncGUID account; /* The account that we are reconciling */
gnc_numeric new_ending; /* The new ending balance */
time_t statement_date; /* The statement date */
gnc_numeric new_ending; /* The new ending balance */
time_t statement_date; /* The statement date */
gint component_id; /* id of component */
gint component_id; /* id of component */
GtkWidget *window; /* The reconcile window */
GtkWidget *window; /* The reconcile window */
GtkUIManager *ui_merge;
GtkActionGroup *action_group;
GtkWidget *toolbar; /* Toolbar widget */
gint toolbar_change_cb_id; /* id for toolbar preference change cb */
gint toolbar_change_cb_id2; /* id for toolbar preference change cb */
GtkWidget *toolbar; /* Toolbar widget */
gint toolbar_change_cb_id; /* id for toolbar preference change cb */
gint toolbar_change_cb_id2; /* id for toolbar preference change cb */
GtkWidget *starting; /* The starting balance */
GtkWidget *ending; /* The ending balance */
GtkWidget *recn_date; /* The statement date */
GtkWidget *reconciled; /* The reconciled balance */
GtkWidget *difference; /* Text field, amount left to reconcile */
GtkWidget *starting; /* The starting balance */
GtkWidget *ending; /* The ending balance */
GtkWidget *recn_date; /* The statement date */
GtkWidget *reconciled; /* The reconciled balance */
GtkWidget *difference; /* Text field, amount left to reconcile */
GtkWidget *total_debit; /* Text field, total debit reconciled */
GtkWidget *total_credit; /* Text field, total credit reconciled */
GtkWidget *total_debit; /* Text field, total debit reconciled */
GtkWidget *total_credit; /* Text field, total credit reconciled */
GtkWidget *debit; /* Debit matrix show unreconciled debit */
GtkWidget *credit; /* Credit matrix, shows credits... */
GtkWidget *debit; /* Debit matrix show unreconciled debit */
GtkWidget *credit; /* Credit matrix, shows credits... */
GtkWidget *debit_frame; /* Frame around debit matrix */
GtkWidget *credit_frame; /* Frame around credit matrix */
GtkWidget *debit_frame; /* Frame around debit matrix */
GtkWidget *credit_frame; /* Frame around credit matrix */
gboolean delete_refresh; /* do a refresh upon a window deletion */
gboolean delete_refresh; /* do a refresh upon a window deletion */
};
/* This structure doesn't contain everything involved in the
* startRecnWindow, just pointers that have to be passed in to
* callbacks that need more than one piece of data to operate on.
@ -151,9 +152,9 @@ static void gnc_recn_set_window_name(RecnWindow *recnData);
static gboolean find_by_account (gpointer find_data, gpointer user_data);
/** GLOBALS *********************************************************/
/** GLOBALS ************************************************************/
/* This static indicates the debugging module that this .o belongs to. */
/* static short module = MOD_GUI; */
static QofLogModule log_module = GNC_MOD_GUI;
static time_t gnc_reconcile_last_statement_date = 0;
@ -203,6 +204,7 @@ recn_get_account (RecnWindow *recnData)
return xaccAccountLookup (&recnData->account, gnc_get_current_book ());
}
/********************************************************************\
* recnRecalculateBalance *
* refreshes the balances in the reconcile window *
@ -310,6 +312,7 @@ recnRecalculateBalance (RecnWindow *recnData)
return diff;
}
static gboolean
gnc_start_recn_update_cb(GtkWidget *widget, GdkEventFocus *event,
startRecnWindowData *data)
@ -323,6 +326,7 @@ gnc_start_recn_update_cb(GtkWidget *widget, GdkEventFocus *event,
return FALSE;
}
/* If the user changed the date edit widget, update the
* ending balance to reflect the ending balance of the account
* on the date that the date edit was changed to.
@ -336,18 +340,16 @@ gnc_start_recn_date_changed (GtkWidget *widget, startRecnWindowData *data)
if (data->user_set_value)
return;
new_date = gnc_date_edit_get_date_end (gde);
/* get the balance for the account as of the new date */
new_balance = gnc_ui_account_get_balance_as_of_date (data->account, new_date,
data->include_children);
/* update the amount edit with the amount */
gnc_amount_edit_set_amount (GNC_AMOUNT_EDIT (data->end_value),
new_balance);
}
void
gnc_start_recn_children_changed (GtkWidget *widget, startRecnWindowData *data)
{
@ -358,6 +360,7 @@ gnc_start_recn_children_changed (GtkWidget *widget, startRecnWindowData *data)
gnc_start_recn_date_changed (data->date_value, data);
}
/* For a given account, determine if an auto interest xfer dialog should be
* shown, based on both the per-account flag as well as the global reconcile
* option. The global option is the default that is used if there is no
@ -373,6 +376,7 @@ gnc_recn_interest_xfer_get_auto_interest_xfer_allowed( Account *account )
return xaccAccountGetAutoInterestXfer( account, auto_xfer );
}
/********************************************************************\
* recnInterestXferWindow *
* opens up a window to prompt the user to enter an interest *
@ -405,6 +409,7 @@ gnc_recn_make_interest_window_name(Account *account, char *text)
return title;
}
/* user clicked button in the interest xfer dialog entitled
* "No Auto Interest Payments for this Account".
*/
@ -425,6 +430,7 @@ gnc_recn_interest_xfer_no_auto_clicked_cb(GtkButton *button,
gtk_widget_set_sensitive(GTK_WIDGET(data->xfer_button), TRUE);
}
static void
recnInterestXferWindow( startRecnWindowData *data)
{
@ -522,6 +528,7 @@ recnInterestXferWindow( startRecnWindowData *data)
data->xferData = NULL;
}
/* Set up for the interest xfer window, run the window, and update
* the startRecnWindow if the interest xfer changed anything that matters.
*/
@ -553,6 +560,7 @@ gnc_reconcile_interest_xfer_run(startRecnWindowData *data)
}
}
void
gnc_start_recn_interest_clicked_cb(GtkButton *button, startRecnWindowData *data)
{
@ -568,6 +576,7 @@ gnc_start_recn_interest_clicked_cb(GtkButton *button, startRecnWindowData *data)
gnc_reconcile_interest_xfer_run( data );
}
static void
gnc_save_reconcile_interval(Account *account, time_t statement_date)
{
@ -617,6 +626,7 @@ gnc_save_reconcile_interval(Account *account, time_t statement_date)
xaccAccountSetReconcileLastInterval(account, months, days);
}
/********************************************************************\
* startRecnWindow *
* opens up the window to prompt the user to enter the ending *
@ -637,7 +647,7 @@ startRecnWindow(GtkWidget *parent, Account *account,
gboolean enable_subaccount)
{
GtkWidget *dialog, *end_value, *date_value, *include_children_button;
GladeXML *xml;
GtkBuilder *builder;
startRecnWindowData data = { NULL };
gboolean auto_interest_xfer_option;
GNCPrintAmountInfo print_info;
@ -673,9 +683,11 @@ startRecnWindow(GtkWidget *parent, Account *account,
*/
/* Create the dialog box */
xml = gnc_glade_xml_new ("reconcile.glade", "Reconcile Start Dialog");
dialog = glade_xml_get_widget (xml, "Reconcile Start Dialog");
glade_xml_signal_autoconnect_full(xml, gnc_glade_autoconnect_full_func, &data);
builder = gtk_builder_new();
gnc_builder_add_from_file (builder, "window-reconcile.glade", "Reconcile Start Dialog");
dialog = GTK_WIDGET(gtk_builder_get_object (builder, "Reconcile Start Dialog"));
title = gnc_recn_make_window_name (account);
gtk_window_set_title(GTK_WINDOW(dialog), title);
g_free (title);
@ -690,35 +702,37 @@ startRecnWindow(GtkWidget *parent, Account *account,
GtkWidget *entry, *label;
GtkWidget *interest = NULL;
start_value = glade_xml_get_widget(xml, "start_value");
start_value = GTK_WIDGET(gtk_builder_get_object (builder, "start_value"));
gtk_label_set_text(GTK_LABEL(start_value), xaccPrintAmount (ending, print_info));
include_children_button = glade_xml_get_widget(xml, "subaccount_check");
include_children_button = GTK_WIDGET(gtk_builder_get_object (builder, "subaccount_check"));
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(include_children_button),
data.include_children);
gtk_widget_set_sensitive(include_children_button, enable_subaccount);
date_value = gnc_date_edit_new(*statement_date, FALSE, FALSE);
data.date_value = date_value;
box = glade_xml_get_widget(xml, "date_value_box");
box = GTK_WIDGET(gtk_builder_get_object (builder, "date_value_box"));
gtk_box_pack_start(GTK_BOX(box), date_value, TRUE, TRUE, 0);
label = glade_xml_get_widget(xml, "date_label");
label = GTK_WIDGET(gtk_builder_get_object (builder, "date_label"));
gnc_date_make_mnemonic_target(GNC_DATE_EDIT(date_value), label);
end_value = gnc_amount_edit_new ();
data.end_value = GNC_AMOUNT_EDIT(end_value);
data.original_value = *new_ending;
data.user_set_value = FALSE;
box = glade_xml_get_widget(xml, "ending_value_box");
box = GTK_WIDGET(gtk_builder_get_object (builder, "ending_value_box"));
gtk_box_pack_start(GTK_BOX(box), end_value, TRUE, TRUE, 0);
label = glade_xml_get_widget(xml, "end_label");
label = GTK_WIDGET(gtk_builder_get_object (builder, "end_label"));
gtk_label_set_mnemonic_widget(GTK_LABEL(label), end_value);
gtk_builder_connect_signals_full (builder, gnc_builder_connect_full_func, &data);
gnc_date_activates_default(GNC_DATE_EDIT(date_value), TRUE);
/* need to get a callback on date changes to update the recn balance */
g_signal_connect ( G_OBJECT (date_value), "date_changed",
G_CALLBACK (gnc_start_recn_date_changed), (gpointer) &data );
gnc_date_activates_default(GNC_DATE_EDIT(date_value), TRUE);
print_info.use_symbol = 0;
gnc_amount_edit_set_print_info (GNC_AMOUNT_EDIT (end_value), print_info);
@ -737,7 +751,7 @@ startRecnWindow(GtkWidget *parent, Account *account,
* account, add a button so that the user can pop up the appropriate
* dialog if it isn't automatically popping up.
*/
interest = glade_xml_get_widget(xml, "interest_button");
interest = GTK_WIDGET(gtk_builder_get_object (builder, "interest_button"));
if ( account_type_has_auto_interest_payment( data.account_type ) )
gtk_button_set_label(GTK_BUTTON(interest), _("Enter _Interest Payment...") );
else if ( account_type_has_auto_interest_charge( data.account_type ) )
@ -783,6 +797,7 @@ startRecnWindow(GtkWidget *parent, Account *account,
gnc_save_reconcile_interval(account, *statement_date);
}
gtk_widget_destroy (dialog);
g_object_unref(G_OBJECT(builder));
return (result == GTK_RESPONSE_OK);
}
@ -811,6 +826,7 @@ gnc_reconcile_window_set_sensitivity(RecnWindow *recnData)
gtk_action_set_sensitive(action, sensitive);
}
static void
gnc_reconcile_window_list_cb(GNCReconcileList *list, Split *split,
gpointer data)
@ -821,6 +837,7 @@ gnc_reconcile_window_list_cb(GNCReconcileList *list, Split *split,
recnRecalculateBalance(recnData);
}
/** Popup a contextual menu. This function ends up being called when
* the user right-clicks in the context of a window, or uses the
* keyboard context-menu request key combination (Shift-F10 by
@ -906,6 +923,7 @@ gnc_reconcile_window_button_press_cb (GtkWidget *widget,
return FALSE;
}
static GNCSplitReg *
gnc_reconcile_window_open_register(RecnWindow *recnData)
{
@ -925,6 +943,7 @@ gnc_reconcile_window_open_register(RecnWindow *recnData)
return gsr;
}
static void
gnc_reconcile_window_double_click_cb(GNCReconcileList *list, Split *split,
gpointer data)
@ -942,6 +961,7 @@ gnc_reconcile_window_double_click_cb(GNCReconcileList *list, Split *split,
gnc_split_reg_jump_to_split( gsr, split );
}
static void
gnc_reconcile_window_focus_cb(GtkWidget *widget, GdkEventFocus *event,
gpointer data)
@ -961,6 +981,7 @@ gnc_reconcile_window_focus_cb(GtkWidget *widget, GdkEventFocus *event,
gnc_reconcile_list_unselect_all(other_list);
}
static gboolean
gnc_reconcile_key_press_cb (GtkWidget *widget, GdkEventKey *event,
gpointer data)
@ -993,6 +1014,7 @@ gnc_reconcile_key_press_cb (GtkWidget *widget, GdkEventKey *event,
return TRUE;
}
static void
gnc_reconcile_window_set_titles(RecnWindow *recnData)
{
@ -1022,6 +1044,7 @@ gnc_reconcile_window_set_titles(RecnWindow *recnData)
g_free(title);
}
static GtkWidget *
gnc_reconcile_window_create_list_box(Account *account,
GNCReconcileListType type,
@ -1101,12 +1124,14 @@ gnc_reconcile_window_get_current_split(RecnWindow *recnData)
return split;
}
static void
gnc_ui_reconcile_window_help_cb(GtkWidget *widget, gpointer data)
{
gnc_gnome_help(HF_HELP, HL_RECNWIN);
}
static void
gnc_ui_reconcile_window_change_cb(GtkAction *action, gpointer data)
{
@ -1126,6 +1151,7 @@ gnc_ui_reconcile_window_change_cb(GtkAction *action, gpointer data)
}
}
static void
gnc_ui_reconcile_window_new_cb(GtkButton *button, gpointer data)
{
@ -1138,6 +1164,7 @@ gnc_ui_reconcile_window_new_cb(GtkButton *button, gpointer data)
gnc_split_reg_jump_to_blank( gsr );
}
static void
gnc_ui_reconcile_window_balance_cb(GtkButton *button, gpointer data)
{
@ -1167,6 +1194,7 @@ gnc_ui_reconcile_window_balance_cb(GtkButton *button, gpointer data)
gnc_split_reg_balancing_entry(gsr, account, statement_date, balancing_amount);
}
static void
gnc_ui_reconcile_window_delete_cb(GtkButton *button, gpointer data)
{
@ -1198,6 +1226,7 @@ gnc_ui_reconcile_window_delete_cb(GtkButton *button, gpointer data)
gnc_resume_gui_refresh ();
}
static void
gnc_ui_reconcile_window_edit_cb(GtkButton *button, gpointer data)
{
@ -1231,6 +1260,7 @@ gnc_recn_make_window_name(Account *account)
return title;
}
static void
gnc_recn_set_window_name(RecnWindow *recnData)
{
@ -1243,6 +1273,7 @@ gnc_recn_set_window_name(RecnWindow *recnData)
g_free (title);
}
static void
gnc_recn_edit_account_cb(GtkAction *action, gpointer data)
{
@ -1255,6 +1286,7 @@ gnc_recn_edit_account_cb(GtkAction *action, gpointer data)
gnc_ui_edit_account_window (account);
}
static void
gnc_recn_xfer_cb(GtkAction *action, gpointer data)
{
@ -1267,6 +1299,7 @@ gnc_recn_xfer_cb(GtkAction *action, gpointer data)
gnc_xfer_dialog (recnData->window, account);
}
static void
gnc_recn_scrub_cb(GtkAction *action, gpointer data)
{
@ -1288,6 +1321,7 @@ gnc_recn_scrub_cb(GtkAction *action, gpointer data)
gnc_resume_gui_refresh ();
}
static void
gnc_recn_open_cb(GtkAction *action, gpointer data)
{
@ -1296,6 +1330,7 @@ gnc_recn_open_cb(GtkAction *action, gpointer data)
gnc_reconcile_window_open_register(recnData);
}
static void
gnc_recn_refresh_toolbar(RecnWindow *recnData)
{
@ -1311,6 +1346,7 @@ gnc_recn_refresh_toolbar(RecnWindow *recnData)
g_slist_free(list);
}
static void
gnc_toolbar_change_cb (GConfClient *client,
guint cnxn_id,
@ -1335,6 +1371,7 @@ gnc_toolbar_change_cb (GConfClient *client,
}
}
static void
gnc_get_reconcile_info (Account *account,
gnc_numeric *new_ending,
@ -1405,6 +1442,7 @@ gnc_get_reconcile_info (Account *account,
}
}
static gboolean
find_by_account (gpointer find_data, gpointer user_data)
{
@ -1417,6 +1455,7 @@ find_by_account (gpointer find_data, gpointer user_data)
return guid_equal (&recnData->account, xaccAccountGetGUID (account));
}
static void
recn_set_watches_one_account (gpointer data, gpointer user_data)
{
@ -1450,6 +1489,7 @@ recn_set_watches_one_account (gpointer data, gpointer user_data)
}
}
static void
recn_set_watches (RecnWindow *recnData)
{
@ -1477,6 +1517,7 @@ recn_set_watches (RecnWindow *recnData)
g_list_free (accounts);
}
static void
refresh_handler (GHashTable *changes, gpointer user_data)
{
@ -1507,6 +1548,7 @@ refresh_handler (GHashTable *changes, gpointer user_data)
recnRefresh (recnData);
}
static void
close_handler (gpointer user_data)
{
@ -1515,6 +1557,7 @@ close_handler (gpointer user_data)
gtk_widget_destroy (recnData->window);
}
/********************************************************************\
* recnWindow *
* opens up the window to reconcile an account *
@ -1552,6 +1595,7 @@ recnWindow (GtkWidget *parent, Account *account)
return recnWindowWithBalance (parent, account, new_ending, statement_date);
}
static void
recnWindow_add_widget (GtkUIManager *merge,
GtkWidget *widget,
@ -1561,6 +1605,7 @@ recnWindow_add_widget (GtkUIManager *merge,
gtk_widget_show (widget);
}
/********************************************************************\
* recnWindowWithBalance
*
@ -1884,6 +1929,7 @@ recn_destroy_cb (GtkWidget *w, gpointer data)
g_free (recnData);
}
static void
recn_cancel(RecnWindow *recnData)
{
@ -1905,6 +1951,7 @@ recn_cancel(RecnWindow *recnData)
gnc_close_gui_component_by_data (WINDOW_RECONCILE_CM_CLASS, recnData);
}
static gboolean
recn_delete_cb(GtkWidget *widget, GdkEvent *event, gpointer data)
{
@ -1914,6 +1961,7 @@ recn_delete_cb(GtkWidget *widget, GdkEvent *event, gpointer data)
return TRUE;
}
static gboolean
recn_key_press_cb(GtkWidget *widget, GdkEventKey *event, gpointer data)
{
@ -1930,6 +1978,7 @@ recn_key_press_cb(GtkWidget *widget, GdkEventKey *event, gpointer data)
}
}
/********************************************************************\
* find_payment_account *
* find an account that 'looks like' a payment account for the *
@ -2053,6 +2102,7 @@ recnFinishCB (GtkAction *action, RecnWindow *recnData)
gnc_close_gui_component_by_data (WINDOW_RECONCILE_CM_CLASS, recnData);
}
/********************************************************************\
* recnPostponeCB *
* saves reconcile information for later use *
@ -2089,6 +2139,7 @@ recnPostponeCB (GtkAction *action, gpointer data)
gnc_close_gui_component_by_data (WINDOW_RECONCILE_CM_CLASS, recnData);
}
static void
recnCancelCB (GtkAction *action, gpointer data)
{
@ -2096,6 +2147,7 @@ recnCancelCB (GtkAction *action, gpointer data)
recn_cancel(recnData);
}
/** An array of all of the actions provided by the main window code.
* This includes some placeholder actions for the menus that are
* visible in the menu bar but have no action associated with

View File

@ -33,9 +33,8 @@
#include "qof.h"
#include "gnc-ui.h"
/* This static indicates the debugging module that this .o belongs to. */
/* static short module = MOD_GUI; */
static QofLogModule log_module = GNC_MOD_GUI;
typedef struct
{
@ -47,7 +46,6 @@ typedef struct
GtkWidget * num_edit;
} DupTransDialog;
/* Parses the string value and returns true if it is a
* number. In that case, *num is set to the value parsed.
* Copied from numcell.c */
@ -92,11 +90,13 @@ gnc_dup_trans_dialog_create (GtkWidget * parent, DupTransDialog *dt_dialog,
time_t date, const char *num_str)
{
GtkWidget *dialog;
GladeXML *xml;
GtkBuilder *builder;
xml = gnc_glade_xml_new ("register.glade", "Duplicate Transaction Dialog");
builder = gtk_builder_new();
gnc_builder_add_from_file (builder, "gnc-plugin-page-register.glade", "adjustment1");
gnc_builder_add_from_file (builder, "gnc-plugin-page-register.glade", "Duplicate Transaction Dialog");
dialog = glade_xml_get_widget (xml, "Duplicate Transaction Dialog");
dialog = GTK_WIDGET(gtk_builder_get_object (builder, "Duplicate Transaction Dialog"));
dt_dialog->dialog = dialog;
/* parent */
@ -111,10 +111,10 @@ gnc_dup_trans_dialog_create (GtkWidget * parent, DupTransDialog *dt_dialog,
date_edit = gnc_date_edit_new (date, FALSE, FALSE);
gnc_date_activates_default(GNC_DATE_EDIT(date_edit), TRUE);
hbox = glade_xml_get_widget (xml, "date_hbox");
hbox = GTK_WIDGET(gtk_builder_get_object (builder, "date_hbox"));
gtk_widget_show (date_edit);
label = glade_xml_get_widget (xml, "date_label");
label = GTK_WIDGET(gtk_builder_get_object (builder, "date_label"));
gnc_date_make_mnemonic_target (GNC_DATE_EDIT(date_edit), label);
gtk_box_pack_end (GTK_BOX (hbox), date_edit, TRUE, TRUE, 0);
@ -125,7 +125,7 @@ gnc_dup_trans_dialog_create (GtkWidget * parent, DupTransDialog *dt_dialog,
GtkWidget *num_spin;
long int num;
num_spin = glade_xml_get_widget (xml, "num_spin");
num_spin = GTK_WIDGET(gtk_builder_get_object (builder, "num_spin"));
dt_dialog->num_edit = num_spin;
gtk_entry_set_activates_default(GTK_ENTRY(num_spin), TRUE);
@ -137,6 +137,10 @@ gnc_dup_trans_dialog_create (GtkWidget * parent, DupTransDialog *dt_dialog,
else
gtk_entry_set_text (GTK_ENTRY (num_spin), "");
}
gtk_builder_connect_signals_full (builder, gnc_builder_connect_full_func, dt_dialog);
g_object_unref(G_OBJECT(builder));
}
/********************************************************************\