# HG changeset patch # User IBBoard # Date 1253560647 0 # Node ID eab45344cd56de841bbde3d35cbb2a30d168969e # Parent ca863c69355076e66828e76933cd00d07c616a5d Re #172: Add GTK# UI for showing debugging messages * Add starts of an implementation by subscribing to event and logging out for now Also: * Add file logger to logging config * Tidy up some code diff -r ca863c693550 -r eab45344cd56 FrmMainWindow.cs --- a/FrmMainWindow.cs Tue Sep 15 19:34:17 2009 +0000 +++ b/FrmMainWindow.cs Mon Sep 21 19:17:27 2009 +0000 @@ -134,6 +134,7 @@ WarFoundryLoader.GetDefault().AddLoadDirectory(new DirectoryInfo(Constants.ExecutablePath + Constants.DirectoryString + "data")); WarFoundryLoader.GetDefault().RegisterFactory(WarFoundryXmlFactory.GetFactory()); WarFoundryLoader.GetDefault().RegisterNonNativeFactory(RollcallFactory.GetFactory()); + WarFoundryLoader.GetDefault().FileLoadingFinished += FileLoadingFinished; WarFoundrySaver.SetFileSaver(new WarFoundryXmlSaver()); logger.Debug("Initialising complete - seeing if we can load default army or system"); @@ -189,6 +190,14 @@ } } + private void FileLoadingFinished (List failures) + { + foreach(FileLoadFailure failure in failures) + { + logger.Warn("Failed to load " + failure.FailedFile.FullName + ": " + failure.Message); + } + } + private void RenderCategoryTreeObjectName(TreeViewColumn column, CellRenderer cell, TreeModel model, TreeIter iter) { object o = model.GetValue(iter, 0); @@ -198,13 +207,13 @@ ArmyCategory c = (ArmyCategory)o; string name = ""; - if (Preferences.GetBooleanProperty("ShowCatPercentage")) + if (!Preferences.GetBooleanProperty("ShowCatPercentage")) { - name = Translation.GetTranslation("categoryTreeCatName", "{0} - {1}pts", c.Name, c.PointsTotal); + name = Translation.GetTranslation("categoryTreeCatName", "{0} - {1}pts", c.Name, c.Points); } else { - name = Translation.GetTranslation("categoryTreeCatNamePercentage", "{0} - {1}pts ({2}%)", c.Name, c.PointsTotal, (c.ParentArmy.PointsTotal > 0 ? Math.Round((c.PointsTotal / c.ParentArmy.PointsTotal) * 100) : 0)); + name = Translation.GetTranslation("categoryTreeCatNamePercentage", "{0} - {1}pts ({2}%)", c.Name, c.Points, (c.ParentArmy.Points > 0 ? Math.Round((c.Points / c.ParentArmy.Points) * 100) : 0)); } (cell as CellRendererText).Text = name; @@ -212,7 +221,7 @@ else if (o is IBBoard.WarFoundry.API.Objects.Unit) { IBBoard.WarFoundry.API.Objects.Unit u = (IBBoard.WarFoundry.API.Objects.Unit)o; - string name = Translation.GetTranslation("categoryTreeCatName", "{0} - {1}pts", u.Name, u.PointsValue); + string name = Translation.GetTranslation("unitTreeCatName", "{0} - {1}pts", u.Name, u.Points); (cell as CellRendererText).Text = name; } } diff -r ca863c693550 -r eab45344cd56 IBBoard.WarFoundry.GUI.GTK.csproj --- a/IBBoard.WarFoundry.GUI.GTK.csproj Tue Sep 15 19:34:17 2009 +0000 +++ b/IBBoard.WarFoundry.GUI.GTK.csproj Mon Sep 21 19:17:27 2009 +0000 @@ -61,7 +61,9 @@ PreserveNewest - + + PreserveNewest + diff -r ca863c693550 -r eab45344cd56 WarFoundryGTK.exe.log4net --- a/WarFoundryGTK.exe.log4net Tue Sep 15 19:34:17 2009 +0000 +++ b/WarFoundryGTK.exe.log4net Mon Sep 21 19:17:27 2009 +0000 @@ -1,15 +1,23 @@ - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + diff -r ca863c693550 -r eab45344cd56 gtk-gui/gui.stetic --- a/gtk-gui/gui.stetic Tue Sep 15 19:34:17 2009 +0000 +++ b/gtk-gui/gui.stetic Mon Sep 21 19:17:27 2009 +0000 @@ -294,7 +294,6 @@ True 2 False - False @@ -531,7 +530,6 @@ True 2 False - False @@ -638,7 +636,6 @@ True 2 False - False