changeset 84:9db2112b31d7

Fixes #333: GTK interface doesn't auto-select race if only one exists * Beat GTK into submission and get its hideous API to select a single item if there is only one item Re #308: Make GTK# UI translatable * Add more translations to "New Army" form
author IBBoard <dev@ibboard.co.uk>
date Wed, 29 Dec 2010 16:32:15 +0000
parents 678e9a0392fc
children bfb29a60b802
files FrmNewArmy.cs translations/en.translation
diffstat 2 files changed, 14 insertions(+), 2 deletions(-) [+]
line diff
     1.1 --- a/FrmNewArmy.cs	Wed Dec 29 16:10:21 2010 +0000
     1.2 +++ b/FrmNewArmy.cs	Wed Dec 29 16:32:15 2010 +0000
     1.3 @@ -31,11 +31,12 @@
     1.4  			lstRaces.Selection.Changed += new EventHandler(OnSelectionChanged);
     1.5  			
     1.6  			TreeViewColumn raceColumn = new TreeViewColumn();
     1.7 -			raceColumn.Title = "Race";
     1.8 +			raceColumn.Title = Translation.GetTranslation("frmNewArmyRaceColumn", "race");
     1.9  			CellRendererText raceCell = new CellRendererText();
    1.10  			raceColumn.PackStart(raceCell, true);
    1.11  			lstRaces.AppendColumn(raceColumn);
    1.12  			raceColumn.SetCellDataFunc(raceCell, GtkWarFoundryUtil.RenderWarFoundryObjectName);
    1.13 +			ControlTranslator.TranslateWidget(this);
    1.14  			
    1.15  			if (gameSystem != null)
    1.16  			{
    1.17 @@ -93,6 +94,15 @@
    1.18  		{
    1.19  			GameSystem system = ComboBoxUtils.GetSelectedItem<GameSystem>(systemCombo);
    1.20  			SetRaces(system);
    1.21 +			ListStore model = (ListStore)lstRaces.Model;
    1.22 +
    1.23 +			if (model.IterNChildren() == 1)
    1.24 +			{
    1.25 +				TreeIter iter;
    1.26 +				model.GetIterFirst(out iter);
    1.27 +				lstRaces.Selection.SelectIter(iter);
    1.28 +			}
    1.29 +
    1.30  			logger.Debug("System selection changed: " + (system == null ? "null" : system.Name));
    1.31  			SetOkayButtonState();
    1.32  		}
     2.1 --- a/translations/en.translation	Wed Dec 29 16:10:21 2010 +0000
     2.2 +++ b/translations/en.translation	Wed Dec 29 16:32:15 2010 +0000
     2.3 @@ -41,7 +41,9 @@
     2.4  <translation id="lblArmySize">Army size:</translation>
     2.5  <translation id="defaultUnitName">Unit of {0} {1}</translation>
     2.6  <translation id="statusPanelPoints">{0} pts / {1} pts</translation>
     2.7 -<translation id="FrmNewUnit">Add New {0} Choice</translation>
     2.8 +<translation id="IBBoard.WarFoundry.GUI.GTK.FrmNewArmy">Create Army</translation>	
     2.9 +<translation id="frmNewArmyRaceColumn">Race</translation>
    2.10 +<translation id="IBBoard.WarFoundry.GUI.GTK.FrmNewUnit">Add New {0} Choice</translation>
    2.11  <translation id="IBBoard.WarFoundry.GUI.GTK.FrmAbout">About WarFoundry</translation>
    2.12  <translation id="exportBasicHtmlDialogTitle">Export army</translation>
    2.13  <translation id="exportBasicHtmlCancel">Cancel</translation>