changeset 18:c4d9b1ec75ed

Re #124: Remove "factory factory" * Replace calls to factory factory with direct invocation of "get factory" methods in GTK# UI
author IBBoard <dev@ibboard.co.uk>
date Sat, 15 Aug 2009 09:33:51 +0000
parents 7653fab9d70e
children a191d0655f55
files FrmMainWindow.cs gtk-gui/objects.xml
diffstat 2 files changed, 7 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/FrmMainWindow.cs	Tue Jul 14 18:33:52 2009 +0000
+++ b/FrmMainWindow.cs	Sat Aug 15 09:33:51 2009 +0000
@@ -129,21 +129,10 @@
 			FailedUnitRequirementMethod = new FailedUnitRequirementDelegate(OnFailedUnitRequirement);
 			UnitNameChangedMethod = new StringValChangedDelegate(OnUnitNameChanged);
 			
-			//FIXME: Temporary hack to add paths and factories
+			//FIXME: Temporary hack to add paths and factories before we get preferences and plugins
 			WarFoundryLoader.GetDefault().AddLoadDirectory(new DirectoryInfo(Constants.ExecutablePath + Constants.DirectoryString + "data"));
-			IWarFoundryFactory factory = WarFoundryFactoryFactory.GetFactoryFactory().GetFactory(typeof(WarFoundryXmlFactory));
-			
-			if (factory!=null && factory is WarFoundryXmlFactory)
-			{
-				WarFoundryLoader.GetDefault().RegisterFactory((WarFoundryXmlFactory)factory);
-			}
-			
-			factory = WarFoundryFactoryFactory.GetFactoryFactory().GetFactory(typeof(RollcallFactory));
-			
-			if (factory!=null && factory is RollcallFactory)
-			{
-				WarFoundryLoader.GetDefault().RegisterNonNativeFactory((INonNativeWarFoundryFactory)factory);
-			}
+			WarFoundryLoader.GetDefault().RegisterFactory(WarFoundryXmlFactory.GetFactory());
+			WarFoundryLoader.GetDefault().RegisterNonNativeFactory(RollcallFactory.GetFactory());
 			
 			logger.Debug("Initialising complete - seeing if we can load default army or system");
 								
--- a/gtk-gui/objects.xml	Tue Jul 14 18:33:52 2009 +0000
+++ b/gtk-gui/objects.xml	Sat Aug 15 09:33:51 2009 +0000
@@ -1,2 +1,6 @@
 <objects attr-sync="on">
+  <object type="IBBoard.WarFoundry.GTK.Widgets.UnitDisplayWidget" palette-category="WarFoundry GTK# GUI" allow-children="false" base-type="Gtk.Bin">
+    <itemgroups />
+    <signals />
+  </object>
 </objects>
\ No newline at end of file