[gbrainy/gbrainy3] Remove Mono.Addins support



commit c834caa2f00de85b2bae1b6e02a9d190d9aab038
Author: Jordi Mas <jmas softcatala org>
Date:   Tue Dec 16 02:26:52 2014 -0500

    Remove Mono.Addins support

 configure.ac                                       |   22 ----
 .../Calculation/CalculationSample.addin.xml        |   17 ---
 sample_extensions/Calculation/CalculationSample.cs |  116 -----------------
 sample_extensions/Calculation/Makefile             |    7 -
 sample_extensions/Logic/Makefile                   |    7 -
 sample_extensions/Logic/PuzzleSample.addin.xml     |   17 ---
 sample_extensions/Logic/PuzzleSample.cs            |   48 -------
 sample_extensions/Makefile                         |   11 --
 sample_extensions/Memory/Makefile                  |    7 -
 sample_extensions/Memory/MemorySample.addin.xml    |   17 ---
 sample_extensions/Memory/MemorySample.cs           |  131 --------------------
 sample_extensions/README                           |    5 -
 sample_extensions/calculation_extension.csproj     |   48 -------
 sample_extensions/logic_extension.csproj           |   50 --------
 sample_extensions/memory_extension.csproj          |   50 --------
 src/Clients/Classical/Dialogs/PreferencesDialog.cs |    7 -
 .../Classical/Dialogs/ui/PreferencesDialog.ui      |   16 ---
 src/Clients/Classical/Makefile.am                  |    3 +-
 src/Clients/Classical/gbrainy.cs                   |   22 ----
 src/Clients/Classical/gbrainy.ui                   |    8 --
 src/Clients/WebForms/Makefile.am                   |    1 -
 src/Core/Main/GameManager.cs                       |   68 +----------
 src/Core/Main/Preferences.cs                       |    2 -
 src/Core/Makefile.am                               |    3 +-
 tests/Makefile.am                                  |    1 -
 25 files changed, 3 insertions(+), 681 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 9266732..46bcb2b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -81,7 +81,6 @@ dnl --- Required libraries
 
 GTKSHARP_REQUIRED=2.99.1
 MONO_REQUIRED=3.0.0
-MONO_ADDINS=0.2.0
 CANBERRA_GTK_REQUIRED=0.26
 
 PKG_CHECK_MODULES(GBRAINY_CORE, mono >= $MONO_REQUIRED)
@@ -90,26 +89,6 @@ PKG_CHECK_MODULES(GBRAINY, gtk-sharp-3.0 >= $GTKSHARP_REQUIRED)
 PKG_CHECK_MODULES(GBRAINY, libcanberra-gtk-3-0  >= $CANBERRA_GTK_REQUIRED)
 AC_SUBST(GBRAINY_LIBS)
 
-AC_ARG_ENABLE(addins, AC_HELP_STRING([--disable-addins], [Disable mono-addins support]), , 
enable_addins="no")
-
-enable_addins_sharp="${enable_addins}"
-
- PKG_CHECK_MODULES(MONO_ADDINS,
-       mono-addins0.2 >= $MONO_ADDINS
-       mono-addins0.2-setup >= $MONO_ADDINS
-       mono-addins0.2-gui >= $MONO_ADDINS,
-       enable_addins_sharp="$enable_addins_sharp", enable_addins_sharp=no)
-
-if test "x$enable_addins" = "xyes" -a "x$enable_addins_sharp" = "xno"; then
-       AC_MSG_ERROR([mono-addins was not found or is not up to date. Please install mono-addins of at least 
version $MONO_ADDINS, or disable mono-addins support by --disable-addins])
-fi
-
-if test "x$enable_addins_sharp" = "xyes"; then
-       AC_SUBST(MONO_ADDINS_LIBS)
-       CSC_DEFINES="$CSC_DEFINES -d:MONO_ADDINS"
-fi
-
-AM_CONDITIONAL(ENABLE_ADDINS, test "x$enable_addins_sharp" = "xyes")
 
 PKG_CHECK_MODULES(GBRAINY_CHECK, librsvg-2.0)
 
@@ -216,7 +195,6 @@ help/Makefile
 tools/Defines.cs
 ])
 
-echo "Mono-addins:             ${enable_addins_sharp}"
 echo "NUnit:                   ${enable_tests}"
 echo "Debug enabled:           ${enable_debug}"
 
diff --git a/src/Clients/Classical/Dialogs/PreferencesDialog.cs 
b/src/Clients/Classical/Dialogs/PreferencesDialog.cs
index c9f197d..f594cb7 100644
--- a/src/Clients/Classical/Dialogs/PreferencesDialog.cs
+++ b/src/Clients/Classical/Dialogs/PreferencesDialog.cs
@@ -38,7 +38,6 @@ namespace gbrainy.Clients.Classical.Dialogs
                [Builder.Object] Gtk.RadioButton rb_master;
                [Builder.Object] Gtk.ComboBox themes_combobox;
                [Builder.Object] Gtk.CheckButton englishcheckbutton;
-               [Builder.Object] Gtk.CheckButton loadextensionscheckbutton;
                [Builder.Object] Gtk.CheckButton usesoundscheckbutton;
 
                const int COLUMN_VALUE = 1;
@@ -53,7 +52,6 @@ namespace gbrainy.Clients.Classical.Dialogs
                        minplayedspinbutton.Value = Preferences.Get <int> (Preferences.MinPlayedGamesKey);
                        colorblindcheckbutton.Active = Preferences.Get <bool> (Preferences.ColorBlindKey);
                        englishcheckbutton.Active = Preferences.Get <bool> (Preferences.EnglishKey);
-                       loadextensionscheckbutton.Active = Preferences.Get <bool> 
(Preferences.LoadPlugginsKey);
                        usesoundscheckbutton.Active = Preferences.Get <bool> (Preferences.SoundsKey);
 
                        switch ((GameDifficulty) Preferences.Get <int> (Preferences.DifficultyKey)) {
@@ -91,10 +89,6 @@ namespace gbrainy.Clients.Classical.Dialogs
                                }
                                more = store.IterNext (ref iter);
                        }
-
-                       #if !MONO_ADDINS
-                               loadextensionscheckbutton.Visible = false;
-                       #endif
                }
 
                private GameDifficulty Difficulty {
@@ -134,7 +128,6 @@ namespace gbrainy.Clients.Classical.Dialogs
                        Preferences.Set <int>  (Preferences.MinPlayedGamesKey, (int) 
minplayedspinbutton.Value);
                        Preferences.Set <bool> (Preferences.ColorBlindKey, colorblindcheckbutton.Active);
                        Preferences.Set <bool> (Preferences.EnglishKey, englishcheckbutton.Active);
-                       Preferences.Set <bool> (Preferences.LoadPlugginsKey, 
loadextensionscheckbutton.Active);
                        Preferences.Set <bool> (Preferences.SoundsKey, usesoundscheckbutton.Active);
 
                        TreeIter iter;
diff --git a/src/Clients/Classical/Dialogs/ui/PreferencesDialog.ui 
b/src/Clients/Classical/Dialogs/ui/PreferencesDialog.ui
index 0d4ab3c..1493786 100644
--- a/src/Clients/Classical/Dialogs/ui/PreferencesDialog.ui
+++ b/src/Clients/Classical/Dialogs/ui/PreferencesDialog.ui
@@ -131,22 +131,6 @@
               </packing>
             </child>
             <child>
-              <object class="GtkCheckButton" id="loadextensionscheckbutton">
-                <property name="label" translatable="yes">Search and load extensions when starting</property>
-                <property name="use_action_appearance">False</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">False</property>
-                <property name="xalign">0.5</property>
-                <property name="draw_indicator">True</property>
-              </object>
-              <packing>
-                <property name="expand">True</property>
-                <property name="fill">True</property>
-                <property name="position">3</property>
-              </packing>
-            </child>
-            <child>
               <object class="GtkCheckButton" id="usesoundscheckbutton">
                 <property name="label" translatable="yes">Enable sounds</property>
                 <property name="use_action_appearance">False</property>
diff --git a/src/Clients/Classical/Makefile.am b/src/Clients/Classical/Makefile.am
index 5055f7f..84ea578 100644
--- a/src/Clients/Classical/Makefile.am
+++ b/src/Clients/Classical/Makefile.am
@@ -21,8 +21,7 @@ GBRAINY_CSDISTFILES =                                 \
 
 ASSEMBLIES = \
         $(GBRAINY_LIBS)                \
-        $(MONO_ADDINS_LIBS)            \
-       -r:../../gbrainy.Core.dll       \
+        -r:../../gbrainy.Core.dll      \
        -r:Mono.Posix
 
 RESOURCES =                                                                            \
diff --git a/src/Clients/Classical/gbrainy.cs b/src/Clients/Classical/gbrainy.cs
index 8aefd68..85d84fe 100644
--- a/src/Clients/Classical/gbrainy.cs
+++ b/src/Clients/Classical/gbrainy.cs
@@ -60,7 +60,6 @@ namespace gbrainy.Clients.Classical
                [Builder.Object] Gtk.MenuItem calculation_menuitem;
                [Builder.Object] Gtk.MenuItem memory_menuitem;
                [Builder.Object] Gtk.MenuItem verbal_menuitem;
-               [Builder.Object] Gtk.MenuItem extensions_menuitem;
                [Builder.Object] Gtk.RadioMenuItem vertical_radiomenuitem;
                [Builder.Object] Gtk.RadioMenuItem horizontal_radiomenuitem;
                [Builder.Object] Gtk.MenuItem toolbar_orientation_menuitem;
@@ -71,7 +70,6 @@ namespace gbrainy.Clients.Classical
                GameSession session;
                bool full_screen;
                GameSession.Types initial_session;
-               static bool pluggins_loaded;
 
                public readonly int MIN_TRANSLATION = 80;
 
@@ -118,12 +116,6 @@ namespace gbrainy.Clients.Classical
                        gm.LoadAssemblyGames (Defines.GAME_ASSEMBLY);
                        gm.LoadVerbalAnalogies (System.IO.Path.Combine (Defines.DATA_DIR, 
Defines.VERBAL_ANALOGIES));
                        gm.LoadGamesFromXml (System.IO.Path.Combine (Defines.DATA_DIR, Defines.GAMES_FILE));
-
-                       if (Preferences.Get <bool> (Preferences.LoadPlugginsKey))
-                       {                       
-                               gm.LoadPlugins ();
-                               pluggins_loaded = true;
-                       }
                }
 
                void BuildUI ()
@@ -191,20 +183,6 @@ namespace gbrainy.Clients.Classical
                        if (show_toolbar == false)
                                showtoolbar_menuitem.Active = false;
 
-               #if MONO_ADDINS
-                       extensions_menuitem.Activated += delegate (object sender, EventArgs ar) 
-                       {
-                               if (pluggins_loaded == false)
-                               {                       
-                                       session.GameManager.LoadPlugins ();
-                               }
-                               Mono.Addins.Gui.AddinManagerWindow.Run (app_window);
-                               GameManagerPreload (session.GameManager);
-                               CustomGameDialog.Clear ();
-                       };
-               #else
-                       extensions_menuitem.Visible = false;
-               #endif
                        ActiveInputControls (false);
                }
 
diff --git a/src/Clients/Classical/gbrainy.ui b/src/Clients/Classical/gbrainy.ui
index e09d950..41f7a57 100644
--- a/src/Clients/Classical/gbrainy.ui
+++ b/src/Clients/Classical/gbrainy.ui
@@ -295,14 +295,6 @@
                         <signal name="activate" handler="OnPreferences" swapped="no"/>
                       </object>
                     </child>
-                    <child>
-                      <object class="GtkMenuItem" id="extensions_menuitem">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="label" translatable="yes">Extensions</property>
-                        <property name="use_underline">True</property>
-                      </object>
-                    </child>
                   </object>
                 </child>
               </object>
diff --git a/src/Clients/WebForms/Makefile.am b/src/Clients/WebForms/Makefile.am
index 6a3f446..bab19de 100644
--- a/src/Clients/WebForms/Makefile.am
+++ b/src/Clients/WebForms/Makefile.am
@@ -29,7 +29,6 @@ GBRAINY_CSDISTFILES =         \
 
 ASSEMBLIES = \
         $(GBRAINY_LIBS)                \
-        $(MONO_ADDINS_LIBS)            \
        -r:System.Web                   \
        -r:Mono.Cairo.dll               \
        -r:../../gbrainy.Core.dll       \
diff --git a/src/Core/Main/GameManager.cs b/src/Core/Main/GameManager.cs
index bb3d758..c1ec6d9 100644
--- a/src/Core/Main/GameManager.cs
+++ b/src/Core/Main/GameManager.cs
@@ -22,12 +22,6 @@ using System.Collections.Generic;
 using System.Reflection;
 
 using gbrainy.Core.Services;
-
-#if MONO_ADDINS
-using Mono.Addins;
-using Mono.Addins.Setup;
-#endif
-
 using gbrainy.Core.Main.Verbal;
 using gbrainy.Core.Main.Xml;
 
@@ -177,60 +171,6 @@ namespace gbrainy.Core.Main
                        }
                }
 
-               // Load Mono plugins
-               public void LoadPlugins ()
-               {
-
-       #if MONO_ADDINS
-                       try {
-                               ExtensionNodeList addins;
-                               Game game;
-                               Type [] type = new Type [1];
-                               string dir = System.IO.Path.Combine (Environment.GetFolderPath 
(Environment.SpecialFolder.ApplicationData), "gbrainy");
-
-                               AddinManager.Initialize (dir);
-                               AddinManager.Registry.Update (null);
-                               new SetupService (AddinManager.Registry);
-
-                               addins = AddinManager.GetExtensionNodes ("/gbrainy/games/logic");
-                               foreach (TypeExtensionNode node in addins) {
-                                       game = (Game) node.CreateInstance ();
-                                       Console.WriteLine ("Loading external logic game: {0}", game);
-                                       type [0] = game.GetType ();
-                                       AddGamesAndVariations (type);
-                               }
-
-                               addins = AddinManager.GetExtensionNodes ("/gbrainy/games/memory");
-                               foreach (TypeExtensionNode node in addins) {
-                                       game = (Game) node.CreateInstance ();
-                                       Console.WriteLine ("Loading external memory game: {0}", game);
-                                       type [0] = game.GetType ();
-                                       AddGamesAndVariations (type);
-                               }
-
-                               addins = AddinManager.GetExtensionNodes ("/gbrainy/games/calculation");
-                               foreach (TypeExtensionNode node in addins) {
-                                       game = (Game) node.CreateInstance ();
-                                       Console.WriteLine ("Loading external calculation game: {0}", game);
-                                       type [0] = game.GetType ();
-                                       AddGamesAndVariations (type);
-                               }
-
-                               addins = AddinManager.GetExtensionNodes ("/gbrainy/games/verbal");
-                               foreach (TypeExtensionNode node in addins) {
-                                       game = (Game) node.CreateInstance ();
-                                       Console.WriteLine ("Loading external verbal analogy game: {0}", game);
-                                       type [0] = game.GetType ();
-                                       AddGamesAndVariations (type);
-                               }
-                       }
-                       catch (Exception e)
-                       {
-                               Console.WriteLine ("GameManager.LoadPlugins. Error loading plugins. Error 
{0}", e);
-                       }
-       #endif
-               }
-
                // Load an XML file with analogies
                public void LoadVerbalAnalogies (string file)
                {
@@ -247,12 +187,6 @@ namespace gbrainy.Core.Main
                public string GetGamesSummary (ITranslations translations)
                {
                        String s = string.Empty;
-       #if MONO_ADDINS
-                       s += translations.GetString ("Extensions database:") + " " +
-                                       System.IO.Path.Combine (Environment.GetFolderPath 
(Environment.SpecialFolder.ApplicationData), "gbrainy");
-
-                       s += Environment.NewLine;
-       #endif
                        // Translators: 'Games registered' is the games know to gbrainy (build-in and load 
from addins-in and external files)
                        s += String.Format (translations.GetString ("{0} games registered: {1} logic puzzles, 
{2} calculation trainers, {3} memory trainers, {4} verbal analogies"),
                                        cnt_logic + cnt_memory + cnt_calculation + cnt_verbal,
@@ -297,4 +231,4 @@ namespace gbrainy.Core.Main
                        return cnt;
                }
        }
-}
+}       
diff --git a/src/Core/Main/Preferences.cs b/src/Core/Main/Preferences.cs
index 2322efb..49bce05 100644
--- a/src/Core/Main/Preferences.cs
+++ b/src/Core/Main/Preferences.cs
@@ -42,7 +42,6 @@ namespace gbrainy.Core.Main
                public const string ThemeKey = "Theme";
                public const string EnglishKey = "English";
                public const string EnglishVersionKey = "EnglishVersion";
-               public const string LoadPlugginsKey = "LoadExtensions";
                public const string SoundsKey = "Sounds";
 
                static Preferences ()
@@ -141,7 +140,6 @@ namespace gbrainy.Core.Main
                        defaults.Add (ThemeKey, "notebook");
                        defaults.Add (EnglishVersionKey, string.Empty);
                        defaults.Add (EnglishKey, false.ToString ());
-                       defaults.Add (LoadPlugginsKey, false.ToString ());
                        defaults.Add (SoundsKey, true.ToString ());
                }
 
diff --git a/src/Core/Makefile.am b/src/Core/Makefile.am
index 7184755..92c58ed 100644
--- a/src/Core/Makefile.am
+++ b/src/Core/Makefile.am
@@ -94,8 +94,7 @@ REFS =  \
        -r:System \
        -r:Mono.Posix                   \
        -r:Mono.CSharp.dll              \
-        $(GBRAINY_LIBS)                \
-        $(MONO_ADDINS_LIBS)
+        $(GBRAINY_LIBS)
 
 RES_CSFLAGS = $(foreach res, $(RES), -resource:$(res))
 
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 6bc2c73..3ab8859 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -32,7 +32,6 @@ if ENABLE_TESTS
 
 ASSEMBLIES = \
        $(NUNIT_LIBS)                   \
-       $(MONO_ADDINS_LIBS)             \
        -r:$(top_builddir)/src/gbrainy.Core.dll \
        -r:$(top_builddir)/src/gbrainy.exe
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]