mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Payment dialog layout improvements
- Rearrange the frames so that the Transfer Account frame gets more space - Add tooltips to (owner), (invoice) and amount related widgets. - Properly align the invoice_label widget git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18474 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
@@ -431,6 +431,9 @@ new_payment_window (GncOwner *owner, QofBook *book, GncInvoice *invoice)
|
||||
PaymentWindow *pw;
|
||||
GladeXML *xml;
|
||||
GtkWidget *box, *label;
|
||||
GtkTooltips *dialog_tips;
|
||||
gchar *tooltip;
|
||||
const gchar *ownerlabel, *invoicelabel;
|
||||
char * cm_class = (gncOwnerGetType (owner) == GNC_OWNER_CUSTOMER ?
|
||||
DIALOG_PAYMENT_CUSTOMER_CM_CLASS :
|
||||
DIALOG_PAYMENT_VENDOR_CM_CLASS);
|
||||
@@ -464,6 +467,9 @@ new_payment_window (GncOwner *owner, QofBook *book, GncInvoice *invoice)
|
||||
/* Open and read the XML */
|
||||
xml = gnc_glade_xml_new ("payment.glade", "Payment Dialog");
|
||||
pw->dialog = glade_xml_get_widget (xml, "Payment Dialog");
|
||||
|
||||
/* Prepare tooltips */
|
||||
dialog_tips = gtk_tooltips_new();
|
||||
|
||||
/* Grab the widgets and build the dialog */
|
||||
pw->num_entry = glade_xml_get_widget (xml, "num_entry");
|
||||
@@ -474,11 +480,29 @@ new_payment_window (GncOwner *owner, QofBook *book, GncInvoice *invoice)
|
||||
label = glade_xml_get_widget (xml, "owner_label");
|
||||
box = glade_xml_get_widget (xml, "owner_box");
|
||||
pw->owner_choice = gnc_owner_select_create (label, box, book, owner);
|
||||
ownerlabel = gtk_label_get_text(GTK_LABEL(label));
|
||||
|
||||
/* Add tooltip to onwer widgets*/
|
||||
tooltip = g_strdup_printf(_("The %s this payment relates to."), ownerlabel);
|
||||
gtk_tooltips_set_tip (dialog_tips, label, tooltip, NULL);
|
||||
gtk_tooltips_set_tip (dialog_tips, box, tooltip, NULL);
|
||||
g_free (tooltip);
|
||||
|
||||
label = glade_xml_get_widget (xml, "invoice_label");
|
||||
box = glade_xml_get_widget (xml, "invoice_box");
|
||||
pw->invoice_choice = gnc_invoice_select_create (box, book, owner, invoice, label);
|
||||
invoicelabel = gtk_label_get_text(GTK_LABEL(label));
|
||||
|
||||
/* Add tooltip */
|
||||
tooltip = g_strdup_printf(_(
|
||||
"The %s to assign this payment to.\n\nNote that is field is optional. "
|
||||
"If you leave it blank, GnuCash will automatically assign the payment to the "
|
||||
"first unpaid %s for this %s."), invoicelabel, invoicelabel, ownerlabel);
|
||||
gtk_tooltips_set_tip (dialog_tips, label, tooltip, NULL);
|
||||
gtk_tooltips_set_tip (dialog_tips, box, tooltip, NULL);
|
||||
g_free (tooltip);
|
||||
|
||||
label = glade_xml_get_widget (xml, "amount_label");
|
||||
box = glade_xml_get_widget (xml, "amount_box");
|
||||
pw->amount_edit = gnc_amount_edit_new ();
|
||||
gtk_box_pack_start (GTK_BOX (box), pw->amount_edit, TRUE, TRUE, 0);
|
||||
@@ -486,6 +510,18 @@ new_payment_window (GncOwner *owner, QofBook *book, GncInvoice *invoice)
|
||||
TRUE);
|
||||
gnc_amount_edit_set_amount (GNC_AMOUNT_EDIT (pw->amount_edit), gnc_numeric_zero());
|
||||
|
||||
/* Add tooltip */
|
||||
tooltip = g_strdup_printf(_(
|
||||
"The amount to pay for this %s.\n\nIf you have selected a %s, GnuCash "
|
||||
"will propose the amount still due for it here, but you can "
|
||||
"decrease it for a partial payment or increase it for an over-payment. "
|
||||
"In case of an over-payment or if no %s was selected, GnuCash will automatically "
|
||||
"assign the additional amount to the first unpaid %s for this %s."),
|
||||
ownerlabel, invoicelabel, invoicelabel, invoicelabel, ownerlabel);
|
||||
gtk_tooltips_set_tip (dialog_tips, label, tooltip, NULL);
|
||||
gtk_tooltips_set_tip (dialog_tips, box, tooltip, NULL);
|
||||
g_free (tooltip);
|
||||
|
||||
box = glade_xml_get_widget (xml, "date_box");
|
||||
pw->date_edit = gnc_date_edit_new (time(NULL), FALSE, FALSE);
|
||||
gtk_box_pack_start (GTK_BOX (box), pw->date_edit, TRUE, TRUE, 0);
|
||||
|
||||
@@ -67,6 +67,11 @@
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkHBox" id="hlayoutbox">
|
||||
<property name="visible">True</property>
|
||||
<property name="homogeneous">False</property>
|
||||
<property name="spacing">3</property>
|
||||
<child>
|
||||
<widget class="GtkVBox" id="vbox1">
|
||||
<property name="visible">True</property>
|
||||
@@ -124,10 +129,10 @@
|
||||
<property name="label">(invoice)</property>
|
||||
<property name="use_underline">False</property>
|
||||
<property name="use_markup">False</property>
|
||||
<property name="justify">GTK_JUSTIFY_LEFT</property>
|
||||
<property name="justify">GTK_JUSTIFY_RIGHT</property>
|
||||
<property name="wrap">False</property>
|
||||
<property name="selectable">False</property>
|
||||
<property name="xalign">0.5</property>
|
||||
<property name="xalign">1</property>
|
||||
<property name="yalign">0.5</property>
|
||||
<property name="xpad">0</property>
|
||||
<property name="ypad">0</property>
|
||||
@@ -144,7 +149,7 @@
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label3">
|
||||
<widget class="GtkLabel" id="date_label">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Date</property>
|
||||
<property name="use_underline">False</property>
|
||||
@@ -169,7 +174,7 @@
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label2">
|
||||
<widget class="GtkLabel" id="amount_label">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Amount</property>
|
||||
<property name="use_underline">False</property>
|
||||
@@ -194,7 +199,7 @@
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label4">
|
||||
<widget class="GtkLabel" id="num_label">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Num</property>
|
||||
<property name="use_underline">False</property>
|
||||
@@ -219,7 +224,7 @@
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label5">
|
||||
<widget class="GtkLabel" id="memo_label">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Memo</property>
|
||||
<property name="use_underline">False</property>
|
||||
@@ -449,6 +454,13 @@
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkFrame" id="frame3">
|
||||
<property name="visible">True</property>
|
||||
@@ -458,6 +470,7 @@
|
||||
|
||||
<child>
|
||||
<widget class="GtkScrolledWindow" id="acct_window">
|
||||
<property name="width_request">250</property>
|
||||
<property name="border_width">3</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
|
||||
@@ -500,13 +513,14 @@
|
||||
<property name="fill">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
|
||||
Reference in New Issue
Block a user