diff FrmEditEquipment.cs @ 92:58779fcd0166

Re #308: Make GTK# UI translatable * Switch lots of labels to translatable versions * Swap some default text to lower-case to make it easier to spot missing translations
author IBBoard <dev@ibboard.co.uk>
date Fri, 31 Dec 2010 12:01:18 +0000
parents 7055b24cfc79
children b4416ca69153
line wrap: on
line diff
--- a/FrmEditEquipment.cs	Fri Dec 31 11:36:06 2010 +0000
+++ b/FrmEditEquipment.cs	Fri Dec 31 12:01:18 2010 +0000
@@ -11,28 +11,26 @@
 using log4net.Repository.Hierarchy;
 using log4net;
 using IBBoard.GtkSharp.Translatable;
+using IBBoard.Lang;
 
 namespace IBBoard.WarFoundry.GUI.GTK
 {
 	public partial class FrmEditEquipment : TranslatableDialog, IEditEquipmentUI
 	{
 		private static ILog log = LogManager.GetLogger(typeof(FrmAddEquipment));
+
 		public event SingleArgMethodInvoker<UnitEquipmentItem> UnitEquipmentItemChoiceChanged;
 		public event MethodInvoker UnitEquipmentAmountTypeChanged;
 		public event MethodInvoker UnitEquipmentAmountChanged;
 
 		private bool isRatioLimited;
-				
+
 		public FrmEditEquipment()
 		{
 			this.Build();
-			TreeViewColumn equipColumn = new TreeViewColumn();
-			equipColumn.Title = "Equipment";
-			CellRendererText equipCell = new CellRendererText();
-			equipColumn.PackStart(equipCell, true);
-			equipColumn.SetCellDataFunc(equipCell, GtkWarFoundryUtil.RenderWarFoundryObjectName);	
+			Translate();
 		}
-		
+
 		public void ListenToWidgets()
 		{
 			rbEquipAll.Clicked += RadioButtonClicked;
@@ -41,7 +39,7 @@
 			numericAmount.ValueChanged += SpinButtonValueChanged;
 			percentageAmount.ValueChanged += SpinButtonValueChanged;
 		}
-		
+
 		public void IgnoreWidgets()
 		{
 			rbEquipAll.Clicked -= RadioButtonClicked;
@@ -50,7 +48,7 @@
 			numericAmount.ValueChanged -= SpinButtonValueChanged;
 			percentageAmount.ValueChanged -= SpinButtonValueChanged;
 		}
-		
+
 		private void OnUnitEquipmentAmountChanged()
 		{
 			if (UnitEquipmentAmountChanged != null)
@@ -58,7 +56,7 @@
 				UnitEquipmentAmountChanged();
 			}
 		}
-		
+
 		private void OnUnitEquipmentAmountTypeChanged()
 		{
 			if (UnitEquipmentAmountChanged != null)
@@ -108,41 +106,41 @@
 			this.Hide();
 			return okayClicked;
 		}
-		
+
 		protected virtual void CancelButtonClicked(object sender, System.EventArgs e)
 		{
 			log.Debug("Cancel clicked");
 			Respond(ResponseType.Cancel);
 		}	
-		
+
 		protected virtual void OkayButtonClicked(object sender, System.EventArgs e)
 		{
 			log.Debug("Okay clicked");
 			Respond(ResponseType.Ok);
 		}		
-		
+
 		public void SetOkayEnabledState(bool enabled)
 		{
 			buttonOk.Sensitive = enabled;
 		}
-				
+
 		protected virtual void SpinButtonValueChanged(object sender, System.EventArgs e)
 		{
 			OnUnitEquipmentAmountChanged();
 		}		
-		
+
 		protected virtual void RadioButtonClicked(object sender, System.EventArgs e)
 		{
 			OnUnitEquipmentAmountTypeChanged();
 		}
-		
+
 		public void SetNumericAmountEnabledState(bool enabled)
 		{
 			double minPercent = GetMinPercentage();
 			rbEquipNumeric.Sensitive = enabled && !(isRatioLimited && minPercent == 100);
 			numericAmount.Sensitive = rbEquipNumeric.Sensitive;
 		}		
-		
+
 		public void SetPercentageAmountEnabledState(bool enabled)
 		{
 			if (enabled)
@@ -176,7 +174,7 @@
 			percentageAmount.GetRange(out min, out max);
 			return min;
 		}		
-		
+
 		public bool IsRatioEquipmentAmount
 		{
 			get
@@ -184,7 +182,7 @@
 				return !rbEquipNumeric.Active;
 			}
 		}
-		
+
 		public int EquipmentNumericAmount
 		{
 			get
@@ -197,7 +195,7 @@
 				numericAmount.Value = value;
 			}
 		}
-		
+
 		public double EquipmentPercentageAmount
 		{
 			get