mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Herbert Thoma's transfer dialog patch for accountant headers
* src/gnome-utils/transfer.glade: rename from_xxx and to_xxx account tree widgets to left_xxx and right_xxx * src/gnome-utils/dialog-transfer.c: if in "accountant mode" call "transfer from" "credit account" and "transfer to" "debit account" and interchange account trees git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@9806 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
d0beccbd88
commit
bbe599b144
@ -19,6 +19,14 @@
|
|||||||
and hbci which should allow running with ofx and hbci in the
|
and hbci which should allow running with ofx and hbci in the
|
||||||
build tree.
|
build tree.
|
||||||
|
|
||||||
|
2004-01-19 Herbert Thoma <herbie@hthoma.de>
|
||||||
|
|
||||||
|
* src/gnome-utils/transfer.glade: rename from_xxx and to_xxx account
|
||||||
|
tree widgets to left_xxx and right_xxx
|
||||||
|
* src/gnome-utils/dialog-transfer.c: if in "accountant mode" call
|
||||||
|
"transfer from" "credit account" and "transfer to" "debit account"
|
||||||
|
and interchange account trees
|
||||||
|
|
||||||
2004-01-16 Derek Atkins <derek@ihtfp.com>
|
2004-01-16 Derek Atkins <derek@ihtfp.com>
|
||||||
|
|
||||||
* configure.in: fix a typo in the help (was --diable-gui). Fixes #131414
|
* configure.in: fix a typo in the help (was --diable-gui). Fixes #131414
|
||||||
|
@ -88,6 +88,9 @@ struct _xferDialog
|
|||||||
gint desc_cursor_position;
|
gint desc_cursor_position;
|
||||||
gboolean desc_didquickfill;
|
gboolean desc_didquickfill;
|
||||||
|
|
||||||
|
GtkWidget * from_transfer_frame;
|
||||||
|
GtkWidget * to_transfer_frame;
|
||||||
|
|
||||||
GtkWidget * from_currency_label;
|
GtkWidget * from_currency_label;
|
||||||
GtkWidget * to_currency_label;
|
GtkWidget * to_currency_label;
|
||||||
|
|
||||||
@ -417,6 +420,11 @@ gnc_xfer_dialog_fill_tree_frame(XferDialog *xferData,
|
|||||||
GtkWidget *scroll_win;
|
GtkWidget *scroll_win;
|
||||||
GtkWidget *button;
|
GtkWidget *button;
|
||||||
GtkWidget *tree;
|
GtkWidget *tree;
|
||||||
|
gboolean use_accounting_labels;
|
||||||
|
|
||||||
|
use_accounting_labels = gnc_lookup_boolean_option("Accounts",
|
||||||
|
"Use accounting labels",
|
||||||
|
FALSE);
|
||||||
|
|
||||||
tree = gnc_account_tree_new();
|
tree = gnc_account_tree_new();
|
||||||
atree = GNC_ACCOUNT_TREE (tree);
|
atree = GNC_ACCOUNT_TREE (tree);
|
||||||
@ -430,9 +438,27 @@ gnc_xfer_dialog_fill_tree_frame(XferDialog *xferData,
|
|||||||
gnc_account_tree_hide_income_expense(GNC_ACCOUNT_TREE(tree));
|
gnc_account_tree_hide_income_expense(GNC_ACCOUNT_TREE(tree));
|
||||||
gnc_account_tree_refresh(GNC_ACCOUNT_TREE(tree));
|
gnc_account_tree_refresh(GNC_ACCOUNT_TREE(tree));
|
||||||
|
|
||||||
scroll_win = gnc_glade_lookup_widget (xferData->dialog,
|
/* In "normal" mode (non accounting terms) the account where the
|
||||||
(direction == XFER_DIALOG_TO) ?
|
* money comes from is displayed on the left side and the account
|
||||||
"to_window" : "from_window");
|
* where the money gets transferred to is displayed on the right
|
||||||
|
* side. In accounting terms the "from" account is called the
|
||||||
|
* "credit" account ("Haben" in german) and the "to" account is
|
||||||
|
* called "debit" account ("Soll" in german). Accountants told me
|
||||||
|
* that they always want the credit account on the right side
|
||||||
|
* and the debit on the left side (like the debit and credit
|
||||||
|
* columns in the register window). So reverse from and to account
|
||||||
|
* trees when in "accountant" mode. -- Herbert Thoma, 2004-01-18
|
||||||
|
*/
|
||||||
|
if(use_accounting_labels) {
|
||||||
|
scroll_win = gnc_glade_lookup_widget (xferData->dialog,
|
||||||
|
(direction == XFER_DIALOG_TO) ?
|
||||||
|
"left_trans_window" : "right_trans_window");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
scroll_win = gnc_glade_lookup_widget (xferData->dialog,
|
||||||
|
(direction == XFER_DIALOG_TO) ?
|
||||||
|
"right_trans_window" : "left_trans_window");
|
||||||
|
}
|
||||||
|
|
||||||
if (direction == XFER_DIALOG_TO)
|
if (direction == XFER_DIALOG_TO)
|
||||||
xferData->to_window = scroll_win;
|
xferData->to_window = scroll_win;
|
||||||
@ -456,9 +482,16 @@ gnc_xfer_dialog_fill_tree_frame(XferDialog *xferData,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
button = gnc_glade_lookup_widget (xferData->dialog,
|
if(use_accounting_labels) {
|
||||||
(direction == XFER_DIALOG_TO) ?
|
button = gnc_glade_lookup_widget (xferData->dialog,
|
||||||
"to_show_button" : "from_show_button");
|
(direction == XFER_DIALOG_TO) ?
|
||||||
|
"left_show_button" : "right_show_button");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
button = gnc_glade_lookup_widget (xferData->dialog,
|
||||||
|
(direction == XFER_DIALOG_TO) ?
|
||||||
|
"right_show_button" : "left_show_button");
|
||||||
|
}
|
||||||
|
|
||||||
if (direction == XFER_DIALOG_TO)
|
if (direction == XFER_DIALOG_TO)
|
||||||
xferData->to_show_button = button;
|
xferData->to_show_button = button;
|
||||||
@ -1635,6 +1668,11 @@ gnc_xfer_dialog_create(GtkWidget * parent, XferDialog *xferData)
|
|||||||
{
|
{
|
||||||
GtkWidget *dialog;
|
GtkWidget *dialog;
|
||||||
GladeXML *xml;
|
GladeXML *xml;
|
||||||
|
gboolean use_accounting_labels;
|
||||||
|
|
||||||
|
use_accounting_labels = gnc_lookup_boolean_option("Accounts",
|
||||||
|
"Use accounting labels",
|
||||||
|
FALSE);
|
||||||
|
|
||||||
ENTER(" ");
|
ENTER(" ");
|
||||||
xml = gnc_glade_xml_new ("transfer.glade", "Transfer Dialog");
|
xml = gnc_glade_xml_new ("transfer.glade", "Transfer Dialog");
|
||||||
@ -1719,7 +1757,7 @@ gnc_xfer_dialog_create(GtkWidget * parent, XferDialog *xferData)
|
|||||||
|
|
||||||
/* from and to */
|
/* from and to */
|
||||||
{
|
{
|
||||||
GtkWidget *label;
|
GtkWidget *label, *frame;
|
||||||
|
|
||||||
gnc_xfer_dialog_fill_tree_frame(xferData, XFER_DIALOG_TO);
|
gnc_xfer_dialog_fill_tree_frame(xferData, XFER_DIALOG_TO);
|
||||||
gnc_xfer_dialog_fill_tree_frame(xferData, XFER_DIALOG_FROM);
|
gnc_xfer_dialog_fill_tree_frame(xferData, XFER_DIALOG_FROM);
|
||||||
@ -1731,11 +1769,44 @@ gnc_xfer_dialog_create(GtkWidget * parent, XferDialog *xferData)
|
|||||||
GTK_SIGNAL_FUNC(gnc_xfer_dialog_to_tree_select_cb),
|
GTK_SIGNAL_FUNC(gnc_xfer_dialog_to_tree_select_cb),
|
||||||
xferData);
|
xferData);
|
||||||
|
|
||||||
label = glade_xml_get_widget (xml, "from_currency_label");
|
/* Reverse from and to account trees when in "accountant" mode,
|
||||||
xferData->from_currency_label = label;
|
see comment in function gnc_xfer_dialog_fill_tree_frame */
|
||||||
|
if(use_accounting_labels) {
|
||||||
|
frame = glade_xml_get_widget (xml, "right_trans_frame");
|
||||||
|
xferData->from_transfer_frame = frame;
|
||||||
|
|
||||||
label = glade_xml_get_widget (xml, "to_currency_label");
|
frame = glade_xml_get_widget (xml, "left_trans_frame");
|
||||||
xferData->to_currency_label = label;
|
xferData->to_transfer_frame = frame;
|
||||||
|
|
||||||
|
gtk_frame_set_label(GTK_FRAME(xferData->from_transfer_frame),
|
||||||
|
_("Credit Account"));
|
||||||
|
gtk_frame_set_label(GTK_FRAME(xferData->to_transfer_frame),
|
||||||
|
_("Debit Account"));
|
||||||
|
|
||||||
|
label = glade_xml_get_widget (xml, "right_currency_label");
|
||||||
|
xferData->from_currency_label = label;
|
||||||
|
|
||||||
|
label = glade_xml_get_widget (xml, "left_currency_label");
|
||||||
|
xferData->to_currency_label = label;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
frame = glade_xml_get_widget (xml, "left_trans_frame");
|
||||||
|
xferData->from_transfer_frame = frame;
|
||||||
|
|
||||||
|
frame = glade_xml_get_widget (xml, "right_trans_frame");
|
||||||
|
xferData->to_transfer_frame = frame;
|
||||||
|
|
||||||
|
gtk_frame_set_label(GTK_FRAME(xferData->from_transfer_frame),
|
||||||
|
_("Transfer From"));
|
||||||
|
gtk_frame_set_label(GTK_FRAME(xferData->to_transfer_frame),
|
||||||
|
_("Transfer To"));
|
||||||
|
|
||||||
|
label = glade_xml_get_widget (xml, "left_currency_label");
|
||||||
|
xferData->from_currency_label = label;
|
||||||
|
|
||||||
|
label = glade_xml_get_widget (xml, "right_currency_label");
|
||||||
|
xferData->to_currency_label = label;
|
||||||
|
}
|
||||||
|
|
||||||
label = glade_xml_get_widget (xml, "conv_forward");
|
label = glade_xml_get_widget (xml, "conv_forward");
|
||||||
xferData->conv_forward = label;
|
xferData->conv_forward = label;
|
||||||
@ -1788,6 +1859,14 @@ gnc_xfer_dialog_create(GtkWidget * parent, XferDialog *xferData)
|
|||||||
gtk_signal_connect(GTK_OBJECT(xferData->amount_radio), "toggled",
|
gtk_signal_connect(GTK_OBJECT(xferData->amount_radio), "toggled",
|
||||||
GTK_SIGNAL_FUNC(price_amount_radio_toggled_cb),
|
GTK_SIGNAL_FUNC(price_amount_radio_toggled_cb),
|
||||||
xferData);
|
xferData);
|
||||||
|
if(use_accounting_labels) {
|
||||||
|
gtk_label_set_text(GTK_LABEL(GTK_BIN(xferData->amount_radio)->child),
|
||||||
|
_("Debit Amount:"));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
gtk_label_set_text(GTK_LABEL(GTK_BIN(xferData->amount_radio)->child),
|
||||||
|
_("To Amount:"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
gtk_clist_set_selection_mode(GTK_CLIST(xferData->from),
|
gtk_clist_set_selection_mode(GTK_CLIST(xferData->from),
|
||||||
|
@ -320,7 +320,7 @@
|
|||||||
|
|
||||||
<widget>
|
<widget>
|
||||||
<class>GtkFrame</class>
|
<class>GtkFrame</class>
|
||||||
<name>transferfrom-frame</name>
|
<name>left_trans_frame</name>
|
||||||
<border_width>3</border_width>
|
<border_width>3</border_width>
|
||||||
<label>Transfer From</label>
|
<label>Transfer From</label>
|
||||||
<label_xalign>0</label_xalign>
|
<label_xalign>0</label_xalign>
|
||||||
@ -340,7 +340,7 @@
|
|||||||
|
|
||||||
<widget>
|
<widget>
|
||||||
<class>GtkScrolledWindow</class>
|
<class>GtkScrolledWindow</class>
|
||||||
<name>from_window</name>
|
<name>left_trans_window</name>
|
||||||
<hscrollbar_policy>GTK_POLICY_AUTOMATIC</hscrollbar_policy>
|
<hscrollbar_policy>GTK_POLICY_AUTOMATIC</hscrollbar_policy>
|
||||||
<vscrollbar_policy>GTK_POLICY_AUTOMATIC</vscrollbar_policy>
|
<vscrollbar_policy>GTK_POLICY_AUTOMATIC</vscrollbar_policy>
|
||||||
<hupdate_policy>GTK_UPDATE_CONTINUOUS</hupdate_policy>
|
<hupdate_policy>GTK_UPDATE_CONTINUOUS</hupdate_policy>
|
||||||
@ -387,7 +387,7 @@
|
|||||||
|
|
||||||
<widget>
|
<widget>
|
||||||
<class>GtkLabel</class>
|
<class>GtkLabel</class>
|
||||||
<name>from_currency_label</name>
|
<name>left_currency_label</name>
|
||||||
<label> </label>
|
<label> </label>
|
||||||
<justify>GTK_JUSTIFY_CENTER</justify>
|
<justify>GTK_JUSTIFY_CENTER</justify>
|
||||||
<wrap>False</wrap>
|
<wrap>False</wrap>
|
||||||
@ -405,7 +405,7 @@
|
|||||||
|
|
||||||
<widget>
|
<widget>
|
||||||
<class>GtkCheckButton</class>
|
<class>GtkCheckButton</class>
|
||||||
<name>from_show_button</name>
|
<name>left_show_button</name>
|
||||||
<can_focus>True</can_focus>
|
<can_focus>True</can_focus>
|
||||||
<label>Show Income/Expense</label>
|
<label>Show Income/Expense</label>
|
||||||
<active>False</active>
|
<active>False</active>
|
||||||
@ -421,7 +421,7 @@
|
|||||||
|
|
||||||
<widget>
|
<widget>
|
||||||
<class>GtkFrame</class>
|
<class>GtkFrame</class>
|
||||||
<name>transferto-frame</name>
|
<name>right_trans_frame</name>
|
||||||
<border_width>3</border_width>
|
<border_width>3</border_width>
|
||||||
<label>Transfer To</label>
|
<label>Transfer To</label>
|
||||||
<label_xalign>0</label_xalign>
|
<label_xalign>0</label_xalign>
|
||||||
@ -441,7 +441,7 @@
|
|||||||
|
|
||||||
<widget>
|
<widget>
|
||||||
<class>GtkScrolledWindow</class>
|
<class>GtkScrolledWindow</class>
|
||||||
<name>to_window</name>
|
<name>right_trans_window</name>
|
||||||
<hscrollbar_policy>GTK_POLICY_AUTOMATIC</hscrollbar_policy>
|
<hscrollbar_policy>GTK_POLICY_AUTOMATIC</hscrollbar_policy>
|
||||||
<vscrollbar_policy>GTK_POLICY_AUTOMATIC</vscrollbar_policy>
|
<vscrollbar_policy>GTK_POLICY_AUTOMATIC</vscrollbar_policy>
|
||||||
<hupdate_policy>GTK_UPDATE_CONTINUOUS</hupdate_policy>
|
<hupdate_policy>GTK_UPDATE_CONTINUOUS</hupdate_policy>
|
||||||
@ -488,7 +488,7 @@
|
|||||||
|
|
||||||
<widget>
|
<widget>
|
||||||
<class>GtkLabel</class>
|
<class>GtkLabel</class>
|
||||||
<name>to_currency_label</name>
|
<name>right_currency_label</name>
|
||||||
<label> </label>
|
<label> </label>
|
||||||
<justify>GTK_JUSTIFY_CENTER</justify>
|
<justify>GTK_JUSTIFY_CENTER</justify>
|
||||||
<wrap>False</wrap>
|
<wrap>False</wrap>
|
||||||
@ -506,7 +506,7 @@
|
|||||||
|
|
||||||
<widget>
|
<widget>
|
||||||
<class>GtkCheckButton</class>
|
<class>GtkCheckButton</class>
|
||||||
<name>to_show_button</name>
|
<name>right_show_button</name>
|
||||||
<can_focus>True</can_focus>
|
<can_focus>True</can_focus>
|
||||||
<label>Show Income/Expense</label>
|
<label>Show Income/Expense</label>
|
||||||
<active>False</active>
|
<active>False</active>
|
||||||
|
Loading…
Reference in New Issue
Block a user