[banshee] [GtkBaseClient] Implement PostInitializeGtk extension point



commit afa3df5a0cbbdf6bfe8f76687317bec093cf5478
Author: Aaron Bockover <abockover novell com>
Date:   Wed Oct 14 19:07:27 2009 -0400

    [GtkBaseClient] Implement PostInitializeGtk extension point
    
    The /Banshee/ThickClient/GtkBaseClient/PostInitializeGtk
    extension point can be used to instantiate any object
    immediately after Gtk.Application.Init () is invoked in
    GtkBaseClient::InitializeGtk ().

 .../Banshee.Gui/GtkBaseClient.cs                   |   11 +++++++++++
 .../Banshee.ThickClient.addin.xml                  |    5 +++++
 2 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/src/Core/Banshee.ThickClient/Banshee.Gui/GtkBaseClient.cs b/src/Core/Banshee.ThickClient/Banshee.Gui/GtkBaseClient.cs
index d9ef726..ae543f7 100644
--- a/src/Core/Banshee.ThickClient/Banshee.Gui/GtkBaseClient.cs
+++ b/src/Core/Banshee.ThickClient/Banshee.Gui/GtkBaseClient.cs
@@ -29,6 +29,8 @@
 using System;
 using System.IO;
 
+using Mono.Addins;
+
 using Hyena;
 
 using Banshee.Base;
@@ -94,6 +96,15 @@ namespace Banshee.Gui
                 GLib.Thread.Init ();
             }
             Gtk.Application.Init ();
+            
+            foreach (TypeExtensionNode node in AddinManager.GetExtensionNodes
+                ("/Banshee/ThickClient/GtkBaseClient/PostInitializeGtk")) {
+                try {
+                    node.CreateInstance ();
+                } catch (Exception e) {
+                    Log.Exception ("PostInitializeGtk extension failed to run", e);
+                }
+            }
         }
         
         protected void Initialize (bool registerCommonServices)
diff --git a/src/Core/Banshee.ThickClient/Banshee.ThickClient.addin.xml b/src/Core/Banshee.ThickClient/Banshee.ThickClient.addin.xml
index daabd16..e43c3b2 100644
--- a/src/Core/Banshee.ThickClient/Banshee.ThickClient.addin.xml
+++ b/src/Core/Banshee.ThickClient/Banshee.ThickClient.addin.xml
@@ -41,6 +41,11 @@
     <Description>Defines a new GTK+ source view, possibly in conjunction with a Source extension.</Description>
     <ExtensionNode name="SourceView"/>
   </ExtensionPoint>
+  
+  <ExtensionPoint path="/Banshee/ThickClient/GtkBaseClient/PostInitializeGtk">
+    <Description>An extension point that runs immediately after initializing GTK.</Description>
+    <ExtensionNode name="PostInitializeGtk"/>
+  </ExtensionPoint>
 
   <ExtensionPoint path="/Banshee/ThickClient/ContextPane">
     <Description>Defines a new GTK+ context page, for showing contextual information beneath the main track source view.</Description>



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