r18474 - gnucash/trunk/src/business/business-gnome - Payment dialog layout improvements

Geert Janssens gjanssens at code.gnucash.org
Wed Dec 9 10:14:36 EST 2009


Author: gjanssens
Date: 2009-12-09 10:14:35 -0500 (Wed, 09 Dec 2009)
New Revision: 18474
Trac: http://svn.gnucash.org/trac/changeset/18474

Modified:
   gnucash/trunk/src/business/business-gnome/dialog-payment.c
   gnucash/trunk/src/business/business-gnome/glade/payment.glade
Log:
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

Modified: gnucash/trunk/src/business/business-gnome/dialog-payment.c
===================================================================
--- gnucash/trunk/src/business/business-gnome/dialog-payment.c	2009-12-08 20:42:46 UTC (rev 18473)
+++ gnucash/trunk/src/business/business-gnome/dialog-payment.c	2009-12-09 15:14:35 UTC (rev 18474)
@@ -431,6 +431,9 @@
   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 @@
   /* 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 @@
   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 @@
 					 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);

Modified: gnucash/trunk/src/business/business-gnome/glade/payment.glade
===================================================================
--- gnucash/trunk/src/business/business-gnome/glade/payment.glade	2009-12-08 20:42:46 UTC (rev 18473)
+++ gnucash/trunk/src/business/business-gnome/glade/payment.glade	2009-12-09 15:14:35 UTC (rev 18474)
@@ -68,6 +68,11 @@
       </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>
 	  <property name="homogeneous">False</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>



More information about the gnucash-changes mailing list